keras-team / keras-io

Keras documentation, hosted live at keras.io
Apache License 2.0
2.72k stars 2.02k forks source link

Image_captioning: How to save the model? #518

Open Ebimsv opened 3 years ago

Ebimsv commented 3 years ago

Hello I get this error when I try to save the model:

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).

please help me if you know how to resolve this Error

krishnaraj-sr commented 2 years ago

Did you get any solution to this issue?

shaunaa126 commented 1 year ago

I think this is also referenced in this issue https://github.com/keras-team/keras-io/issues/1364

sachinprasadhs commented 1 week ago

Hi, In order to save the model with custom object using Keras saving format .keras you need to override the get_config()method, for detailed steps follow the guide here https://keras.io/guides/serialization_and_saving/#custom-objects