javascript - Tensorflowjs:“未知层:标准化”
问题描述
目前正在尝试将在 python 上训练的 keras 训练(简单回归)模型加载到 javascript(用于 html)中。这个模型最初是通过一个简单的方法保存在 python 中的
model.save("model")
然后通过 tensorflowjs_wizard(在 anaconda 上)转换为 tensorflowjs。
但是通过在js/html中运行代码的过程中,弹出了一个错误,被视为未知层:
Unknown layer: Normalization. This may be due to one of the following reasons:
1. The layer is defined in Python, in which case it needs to be ported to TensorFlow.js or your JavaScript code.
2. The custom layer is defined in JavaScript, but is not registered properly with tf.serialization.registerClass().
at jN (generic_utils.js:242)
at GI (serialization.js:31)
at e.fromConfig (models.js:1026)
at jN (generic_utils.js:277)
at GI (serialization.js:31)
at models.js:295
at u (runtime.js:45)
at Generator._invoke (runtime.js:274)
at Generator.forEach.t.<computed> [as next] (runtime.js:97)
at Wm (runtime.js:728)
我不太确定“移植到 TensorFlow.js”是什么意思有没有人见过这个问题或知道如何解决这个问题?谢谢!!!!
版本:张量流:2.5.0 张量流js:3.8.0
解决方案
推荐阅读
- c# - 有人可以发送 ReadInt32 来写入进程内存吗?
- c# - 为什么 Path 类在文件名中添加“/”?
- php - 在大括号内正确使用动态变量?
- java - 如何将类传递给方法并在该类上调用静态方法
- wix - 如何将三个安装文件合并为一个安装文件?
- python-3.x - 正确地将 matplotlib.rcParams 字典重置为其原始默认值
- android - Firebase 注册令牌和通知问题
- javascript - 未在嵌套数组中设置动态值
- join - Hive:使用 2 个 ON 条件和 NULL 进行 JOIN 的最佳方法
- spring - 如何在 Spring Webclient 中处理 HTTP 状态码