加载自定义模型出错
昨天,我在复现LeNet网络,训练都没有什么问题,我觉得可以保存模型,可就是在读取出现了错误。
保存:
model.save_weights('./model/LeNet_model')
生成文件:
读取:
model=load_model('./model/LeNet_model')
错误显示:
Traceback (most recent call last):
File "D:/py_project/open_cv/LeNet.py", line 34, in <module>
model=load_model('./model/LeNet_model')
File "D:\py_project\venv\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
return load_function(*args, **kwargs)
File "D:\py_project\venv\lib\site-packages\keras\engine\saving.py", line 583, in load_model
with H5Dict(filepath, mode='r') as h5dict:
File "D:\py_project\venv\lib\site-pac