I am training a keras model and saving the weights into a JSON file like so:
with open('weigths.json', 'w') as f:
json.dump(model.get_weigths())
Now I want to load the weights and rebuild the keras model so that I can do testing and prediction
How can I do that?
要保存模型,您应该使用专用的功能keras.model.save(filepath)
,并再次将其装入keras.models.load_model(filepath)
作为解释在这里 。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.