0

I know how to do a few things already:

  • Summarise a model with model.summary(). But this actually doesn't print everything about the model, just the coarse details.

  • Save model with model.save() and load model with keras.models.load_model()

  • Get weights with model.get_weights()

  • Get the training history from model.fit()

But none of these seem to give me a catch all solution for saving everything from end to end so that I can 100% reproduce a model architecture, training setup, and results.

Any help filling in the gaps would be appreciated.

Alexander Soare
  • 2,825
  • 3
  • 25
  • 53
  • Does this answer your question? [Keras: How to save model and continue training?](https://stackoverflow.com/questions/45393429/keras-how-to-save-model-and-continue-training). [This](https://stackoverflow.com/questions/45393429/keras-how-to-save-model-and-continue-training) may also be a viable answer. – Szymon Maszke Feb 19 '20 at 18:33

1 Answers1

0

model.to_json() can be used to convert model config into json format and save it as a json. You can recreate the model from json using model_from_json found in keras.models

Weights can be saved separately using model.save_weights. Useful in checkpointing your model. Note that model.save saves both of these together. Saving only the weights and loading them back useful when you need to work with the variables used in defining the model. In that case create the model using the code and do model.load_weights.

soumith
  • 536
  • 1
  • 3
  • 12