Tensorflow model weights are not saving completely

537 views Asked by At

I'm using Attention Mechanism for Image Captioning, and i saved weights of all layers manually , but when i restart my pc and load the saved weight then model's loss is increased too much, it seems that weights are not properly saved. but i didn't find out any un-saved weight. Any one can help ?

Colab Link

1

There are 1 answers

0
Gerry P On

saving the weights is fine as long as you are running your program. Saving the weights does not preserve other needed information that must be restored once you exit execution for example the state of the optimizer. So in your program have a statement that saves the entire model using model.save before you end execution. Then when you restart your program reload the entire model using model.load. Documentation is here.