model-how to save and load keras model ?

By | April 6, 2018

How to save and load keras model ?

The easiest way to save and load keras model is:

Save model

Load model

save, load keras model

save, load keras model

This technique of saving the model is very useful. This approach saves:

  • Architecture of the model
  • Weights of the model
  • Training state (like loss, optimizer etc.)
  • State of the optimizer, which helps to train from where you left.

Another approach is by saving weights:

Save weights

To load weights, you need to first build the model and then load weights.

Final approach is to save the architecture of the model.