Home

Published

- 1 min read

how to save and load model in keras

img of how to save and load model in keras

The solution for this is noted below

how to save and load model in keras

Solution

   # To save the model:

from keras.models import save_model

# you can write whatever you desire instead of 'my_model'
# model = Your trained model
model.save('my_model')

# To load the model:

from keras.models import load_model

reconstructed_model = load_model("my_model")

Try other methods by searching on the site. That is if this doesn’t work