Вы можете сохранить модель keras
с помощью
# assume model is the trained keras model
# save the underlying tensorflow graph
model_file = model.to_json()
with open("model.json", "w") as source:
source.write(model_file)
# save model parameter
model.save_weights("weights.h5")
Затем сохраненную модель можно загрузить с помощью
from keras.models import model_from_json
with open("model.json", "r") as f:
model = model_from_json(f.read())
model.load_weights("weights.h5")