r - 如何在 Windows 上的 R 中加载 Keras 模型?
问题描述
我很难在 R 中加载 keras 模型(.h5)。这是我尝试过的脚本:
library(keras)
new_model <- load_model_hdf5("model1.h5")
错误信息是:
Error in load_model_hdf5("model1.h5") :
The h5py Python package is required to save and load models
我还尝试以不同的格式保存模型(保存整个模型),但得到了不同的错误消息。这是我尝试过的:
new_model <- load_model_tf('model1')
错误信息是:
Error in if (tensorflow::tf_version() < "2.0.0") stop("TensorFlow version >= 2.0.0 is requires to load models in the SavedModel format.", :
argument is of length zero
解决方案
推荐阅读
- wpf - 如何在底层对象状态更改时触发 ListBoxItem 的样式更改?
- entity-framework - Asp.net 核心 - 实体框架核心 - 将附加数据添加到视图对象,同时保持它是可查询的
- api - Cloudflare API 通过 curl 启用防火墙规则
- amazon-web-services - DynamoDB:是什么导致错误“提供的关键元素与架构不匹配”?
- r - 在 ggplot2-R 中编辑和格式化箱形图(删除时间序列图中的列和箱宽)
- android - 在 Kotlin 中预加载 AdMob 插页式广告
- python - 如何向 Keras 模型添加 POS 标签层?
- windows - powershell icacl 获取文件路径的“不正确的功能”并且帐户名和安全 ID 之间没有映射
- python - 关于在 Python 中存储声明变量的问题?
- python - Pandas:如何用其他列中的部分值填充列的 nan 值