Skip to content

Chapter 12, part 5, GANs - Model cannot be saved because the input shapes have not been set. #175

@Pappa

Description

@Pappa

Using the code on GANs, I'm unable to save the model in TF SavedModel format. Using TensorFlow 2.6.0 in a Kaggle notebook.

I get the following error:

ValueError: Model <__main__.GAN object at 0x7fa982c57810> cannot be saved because the input 
shapes have not been set. Usually, input shapes are automatically determined from calling 
`.fit()` or `.predict()`. To manually set the shapes, call `model.build(input_shape)`.

I have attempted to resolve this by calling model.build(input_shape) after compilation and adding a call method to the GAN subclass, but I'm still seeing the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions