r - ValueError: Unknown config_item:L1L2 for load_model_hdf5 function from Keras package in R
问题描述
我正在使用 Ubuntu 18.04 并安装了带有 tensorflow gpu 2.2 的 keras。我成功地运行了一个模型。当我使用 load_model_hdf5 回忆它时,我得到一个 ValueError: Unknown config_item: L1L2。这是什么错误以及如何解决它?
这是回溯:
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: Unknown config_item: L1L2
16.
stop(structure(list(message = "ValueError: Unknown config_item: L1L2",
call = py_call_impl(callable, dots$args, dots$keywords),
cppstack = structure(list(file = "", line = -1L, stack = c("/home/user/R/x86_64-pc-linux-gnu-library/3.4/reticulate/libs/reticulate.so(Rcpp::exception::exception(char const*, bool)+0x78) [0x7fed7c75fea8]",
"/home/user/R/x86_64-pc-linux-gnu-library/3.4/reticulate/libs/reticulate.so(Rcpp::stop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x27) [0x7fed7c75ff17]", ...
15.
class_and_config_for_serialized_keras_object at generic_utils.py#321
14.
deserialize_keras_object at generic_utils.py#362
13.
class_and_config_for_serialized_keras_object at generic_utils.py#331
12.
deserialize_keras_object at generic_utils.py#362
11.
deserialize at serialization.py#109
10.
from_config at sequential.py#398
9.
deserialize_keras_object at generic_utils.py#373
8.
deserialize at serialization.py#109
7.
model_from_config at model_config.py#55
6.
load_model_from_hdf5 at hdf5_format.py#178
5.
load_model at save.py#184
4.
(structure(function (...)
{
dots <- py_resolve_dots(list(...))
result <- py_call_impl(callable, dots$args, dots$keywords) ...
3.
do.call(keras$models$load_model, args)
2.
load_model(filepath, custom_objects, compile)
1.
load_model_hdf5(paste0(dp, "model", i, ".unfrozen.h5"))
解决方案
推荐阅读
- sql - SQL Server:'<' 和 'day' 附近的语法不正确,期望 '(' 或 SELECT
- c - 使用 C 语言的字符串中的奇怪字符(结构、指针和字符串)
- flutter - MissingPluginException - HttpClient 的权限问题
- kubernetes - Kubernetes 升级计划命令失败,因为 etcd 集群无法使用维护客户端拨打端点 https://192.168.5.12:2379
- app-store-connect - 如何获取安装应用程序的设备数量?
- javascript - 我想了解为什么我作为道具传递给 React 功能组件的数据显示为未定义?
- javascript - PyCharm 中的“事件”字样
- dataset - 如何从 kaggle 中读取无 CSV 数据集?
- keras - 无法识别导致错误的图像 - PIL.UnidentifiedImageError:无法识别图像文件
- python - 计算单元格 j 和单元格 j+1 之间的差异,然后计算数据帧的 j+1 和 j+2、j+2 和 j+3...,并保持挖掘机结果(关闭))