当前位置:   article > 正文

tf2保存加载模型_saving the model to hdf5 format requires the model

saving the model to hdf5 format requires the model to be a functional model

第一 HDF5

可以直接保存整个模型,将模型保存为HDF5文件

# 创建模型实例
model = create_model()
# 保存模型到HDF5文件
model.save('my_model.h5')
# 读取模型
model = keras.models.load_model('my_model.h5')
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

第二 save_model形式

# 创建并训练一个新的模型实例。
model = create_model(
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/492802
推荐阅读
相关标签
  

闽ICP备14008679号