Issue in saving/loading model

I am trying to reproduce the Image Captioning model shared by tensorflow in this blog: Image captioning with visual attention  |  TensorFlow Core

However, when I am trying to save/load the model I am getting the following error:

Kindly help on how to resolve it


Welcome to the Tensorflow Forum,

I see that you are adding while loading the weights which is not a right approach. The model is built while saving the weights and therefore when it is built on a new model instance with random weights, we face the error.

Please find the working gist for reference.

Thank you!

1 Like