TensorflowJS:可以将图形模型转换为图层模型吗?

TensorflowJS: It is possible to convert a graph model to a layers model?

是否可以将图形模型转换为图层模型? 官方的 TensorFlow js converter (https://github.com/tensorflow/tfjs/tree/master/tfjs-converter) 目前不支持此功能,或者有什么原因无法使用?

tfjs 不支持将图形层转换为顺序层。

图形层提供了更多创建模型的能力,它不能缩小到顺序层。

"If you can move mountains you can move molehills",因此层模型可以转换为图形模型。该转换器支持将顺序层转换为图形。但显然反过来是不正确的

图层模型格式支持的功能少于 SavedModel 和图形模型格式,因此您无法将图层转换为图形。但是,我也没有看到相反的转换发生。


当引用加载 graph 模型的函数时,tf.loadGraphModel:

The loaded model only supports only inference, but the speed of inference is generally faster than that of a tfjs_layers_model source

当引用加载模型的函数时,tf.loadLayersModel:

The loaded model supports the full inference and training (e.g., transfer learning) features of the original keras or tf.keras model.

所以我认为答案是: 不是,因为转换库tfjs-converter doesn't support it, probably because the layers format cannot hold the information that a SavedModel or graph model can. ,我试着总结一下2种格式的区别