Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 863 Bytes

how-do-i-save-weights-in-a-python-keras-model.md

File metadata and controls

24 lines (16 loc) · 863 Bytes

How do I save weights in a Python Keras model?

// plain

The weights of a Keras model can be saved in two ways:

  1. Saving the entire model: This will save the model's architecture, weights, and training configuration in a single file. This can be done using the model.save() method.

Example code

model.save('model.h5')
  1. Saving only the weights: This will only save the weights of the model, and not its architecture or training configuration. This can be done using the model.save_weights() method.

Example code

model.save_weights('weights.h5')

Helpful links

onelinerhub: How do I save weights in a Python Keras model?