Issue
I've created a keras subclass model using tensorflow. Snippets are shown below.
class SubModel(Model):
def call(self, inputs):
print(inputs)
model = SubModel()
model.fit(data, labels, ...)
When fit
the model, it will get the inputs and input_shape itself. What I want to do is pass inputs to the model myself.Just like the functional API does.
inputs = tf.keras.input(shape=(100,))
model = tf.keras.Model(inputs=inputs, outputs=outputs)
Solution
Something like that?
model_ = SubModel()
inputs = tf.keras.input(shape=(100,))
outputs = model_(inputs)
model = tf.keras.Model(inputs=inputs, outputs=outputs)
Answered By - gdaras
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.