未能加载tensorflow.js中的模型

未能加载tensorflow.js中的模型,tensorflow,tensorflow.js,Tensorflow,Tensorflow.js,我已经将不同的传输训练模型(VGG16、InceptionV3、EfficientNetB0)从python中的tensorflow转换为tensorflowjs。 在tensorflowjs中实现后,无法加载模型 其中一个错误是: Uncaught Error: Unknown layer: Functional. This may be due to one of the following reasons: 1. The layer is defined in Python, in whi

我已经将不同的传输训练模型(VGG16、InceptionV3、EfficientNetB0)从python中的tensorflow转换为tensorflowjs。 在tensorflowjs中实现后,无法加载模型

其中一个错误是:

Uncaught Error: Unknown layer: Functional. 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)
而且

有什么问题? 如果我使用从可教机器生成的.json文件,则可以加载模型。(然而,由于未知原因,预测完全错误,问题似乎不仅仅是标签问题。) 但是,如果我使用通过tensorflow转换器从.h5或SavedModel生成的model.json文件,无论我使用哪种预训练模型,或生成的文件格式(.h5或SavedModel),该模型都无法加载到javascript中


请帮忙

转到
model.json
文件,搜索关键字
Functional
(您可以使用
ctrl+f Functional
)并将单词替换为
model

这似乎有效!未知层:RandomFlip怎么样?这似乎是由于tensorflow.js无法识别增强层。根据tensorflow官方网站上的教程,我将数据增强层合并为模型层之一。“我该如何处理这个问题?”马克西姆斯你得问另一个问题。我也会尽力回答。你能接受我的问题并投票表决吗?谢谢!接受并投票赞成你的问题。我在以下链接中提出了另一个问题:
jquery-3.3.1.slim.min.js:2 Uncaught Error: Unknown layer: RandomFlip. 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 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)
Failed to load resource: the server responded with a status of 404 ()