Tensorflowjs Save Model 抛出错误:不支持的类型数组子类型:Float32Array



我有一个 tensorflowjs (1.2.7( 概念证明在我的 Mac 上运行在本地。 一切正常,我可以创建一个模型并在尝试保存时进行预测。我收到以下错误。

Unsupported TypedArray subtype: Float32Array
at node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts:207:13
at Array.forEach (<anonymous>)
at concatenateTypedArrays (node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts:199:6)
at Object.<anonymous> (node_modules/@tensorflow/tfjs-core/src/io/io_utils.ts:93:17)
at step (node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js:48:23)
at Object.next (node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js:29:53)
at fulfilled (node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js:20:58)

这似乎只发生在我保存时。 任何帮助将不胜感激。

model.save('file:///path/to/my-model');

我正在使用特定于节点的版本"@tensorflow/tfjs-node"。 https://www.tensorflow.org/js/guide/save_load#native_file_system_nodejs_only

我不愿意采用这种方法(TensorFlow.js:在训练期间保存不同的模型实例(,听起来你输了 以这种方式模型的各个方面。

这与在Jest 单元测试中运行有关。 否则这不是问题。

相关内容

最新更新