在Node.js中加载TensorFlow冻结图(.pb)
我将tensorflow模型保存在一个冻结的PB文件中,该文件适合tensorflow Lite使用。 此文件可以在Android中加载,并通过以下代码运行良好:在Node.js中加载TensorFlow冻结图(.pb),node.js,tensorflow,tensorflow-lite,Node.js,Tensorflow,Tensorflow Lite,我将tensorflow模型保存在一个冻结的PB文件中,该文件适合tensorflow Lite使用。 此文件可以在Android中加载,并通过以下代码运行良好: 导入org.tensorflow.contrib.android.tensorflow推断接口; … TensorFlow推断接口推断接口; 推断接口=新的TensorFlow推断接口(context.getAssets(),“MODEL_FILE.pb”); 有没有办法在Node.js中加载冻结的图形?我找到了解决方案: 1.该
导入org.tensorflow.contrib.android.tensorflow推断接口;
…
TensorFlow推断接口推断接口;
推断接口=新的TensorFlow推断接口(context.getAssets(),“MODEL_FILE.pb”);
有没有办法在Node.js中加载冻结的图形?我找到了解决方案:
1.该模型必须转换为一种web友好格式,即JSON文件。
2.然后可以使用Nodejs中的“@tensorflow/tfjs”加载