Skip to content

Error when running the model.fit on the wrapped model "Only input tensors may be passed as positional arguments." #951

Open
@ashkanee

Description

@ashkanee

When executing (it is the wrapped model):

model.fit(training_dataset, epochs=5) where
training_dataset = tf.data.Dataset.from_tensor_slices((training_input, training_output.T))

I get:

RuntimeError: Exception encountered when calling ModelWrapper.call(). Could not automatically infer the output shape / dtype of 'model_wrapper' (of type ModelWrapper). Either the ModelWrapper.call()method is incorrect, or you need to implement theModelWrapper.compute_output_spec() / compute_output_shape() method. Error encountered: Only input tensors may be passed as positional arguments. The following argument value should be passed as a keyword argument: None (of type <class 'NoneType'>) Arguments received by ModelWrapper.call(): • args=('<KerasTensor shape=(None,), dtype=float32, sparse=None, name=keras_tensor_10>',) • kwargs={'mask': 'None'}

Can you please help? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions