Saving
with open(DIRECTORY, ‘w’) as f:
f.write(model.to_json())
model.save_weights(DIRECTORY)
Loading
with open(DIRECTORY, ‘r’) as f:
model = model_from_json(f.read())
model.load_weights(DIRECTORY)
with open(DIRECTORY, ‘w’) as f:
f.write(model.to_json())
model.save_weights(DIRECTORY)
with open(DIRECTORY, ‘r’) as f:
model = model_from_json(f.read())
model.load_weights(DIRECTORY)