# python-kerasHow do I save weights in a Python Keras model?

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

**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')`

**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

### More of Python Keras

- How can I improve the validation accuracy of my Keras model using Python?
- How do I use Python Keras to create a Zoom application?
- How can I use Python Keras to create a neural network with zero hidden layers?
- How do I use Python Keras to zip a file?
- How can I use XGBoost, Python and Keras together to build a machine learning model?
- How can I visualize a Keras model using Python?
- How do I use validation_data when creating a Keras model in Python?
- How can I use YOLO with Python and Keras?
- How can I install the python module tensorflow.keras in R?

See more codes...