Difference between Keras model.save() and model.save_weights()?

save() saves the weights and the model structure to a single HDF5 file. I believe it also includes things like the optimizer state. Then you can use that HDF5 file with load() to reconstruct the whole model, including weights.

save_weights() only saves the weights to HDF5 and nothing else. You need extra code to reconstruct the model from a JSON file.

Leave a Comment