【发布时间】:2020-08-02 09:27:31
【问题描述】:
我无法在 tensorflow 中保存经过训练的模型
我已经拟合了数据
results = model.fit_generator(train_image_gen,epochs=20,validation_data=test_image_gen,callbacks=early_stop)
并导入
from tensorflow.keras.models import load_model
并写了这样的代码
save1= results.history
save1.save('model.h5')
但它会抛出这样的错误
AttributeError Traceback (most recent call last)
<ipython-input-47-13cfa06fe0cd> in <module>
----> 1 save1.save('model.h5')
AttributeError: 'dict' object has no attribute 'save'
我不知道如何保存此模型,还请帮助我如何将其保存在 yaml 文件中
ps:-我正在研究 kaggle
【问题讨论】:
标签: python tensorflow keras neural-network