我想将保存的Python机器学习模型导入到Nodejs中,用于基于web应用程序的预测
到目前为止所做的工作:
将保存的模型转换为json文件格式:
尝试使用以下方法将保存的文件导入nodejs文件:
const tf = require('@tensorflow/tfjs-node');
const model = tf.loadLayersModel('C:\Users\Desktop\Prod\cate\model.json');
使用命令行执行文件:
获取错误:
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module '@tensorflow/tfjs-core'
**Required Stack:**
C:\Users\Documents\tfjs\node_modules\@tensorflow\tfjs-layers\dist\constraints.js
C:\Users\Documents\tfjs\node_modules\@tensorflow\tfjs-layers\dist\exports_constraints.js
C:\Users\Documents\tfjs\node_modules\@tensorflow\tfjs-layers\dist\index.js
C:\Users\Documents\tfjs\node_modules\@tensorflow\tfjs\dist\index.js
C:\Users\Documents\tfjs\node_modules\@tensorflow\tfjs-node\dist\index.js
C:\Users\Documents\tfjs\script.js
at Object.<anonymous> (C:\Users\Documents\tfjs\node_modules\@tensorflow\tfjs-layers\dist\constraints.js:26:11)
code: 'MODULE_NOT_FOUND',
目前没有回答
相关问题 更多 >
编程相关推荐