Tensorflow.js error: unknown layer: GaussianNoise

Tensorflow.js error: unknown layer: GaussianNoise

我按照 this guide

中的步骤转换了一个预训练的 keras 模型以将其与 Tensorflow.js 一起使用

现在,当我尝试使用

将其导入 javascript 时

const model = tf.loadModel("{% static "keras/model.json" %}");

出现以下错误:

Uncaught (in promise) Error: Unknown layer: GaussianNoise. 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 new t (errors.ts:48)
    at deserializeKerasObject (generic_utils.ts:239)
    at deserialize (serialization.ts:31)
    at t.fromConfig (models.ts:940)
    at deserializeKerasObject (generic_utils.ts:274)
    at deserialize (serialization.ts:31)
    at models.ts:302
    at common.ts:14
    at Object.next (common.ts:14)
    at i (common.ts:14)

我正在使用 Tensorflow.js 的 0.15.3 版本,以这种方式导入:

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.15.3/dist/tf.min.js"></script>

我用 Tensorflow 1.12.0 和 Keras 2.2.4 训练了我的神经网络

您正在使用 tfjs 尚不支持的层 tf.layer.gaussianNoise

考虑用另一个支持的图层更改此图层