from keras.models import load_model
from keras.models import model_from_json
import json
with open('model_in_json.json','r') as f:
model_json = json.load(f)
model = model_from_json(model_json)
model.load_weights('model_weights.h5')
import json
# lets assume `model` is main model
model_json = model.to_json()
with open("model_in_json.json", "w") as json_file:
json.dump(model_json, json_file)
model.save_weights("model_weights.h5")