简体   繁体   English

错误:找不到指定的模块。 \\?\C:\Program Files\nodejs\tf\node_modules\@tensorflow\tfjs-node\lib\napi-v5\tf js_binding.node

[英]Error: The specified module could not be found. \\?\C:\Program Files\nodejs\tf\node_modules\@tensorflow\tfjs-node\lib\napi-v5\tf js_binding.node

I am getting an error when importing '@tensorflow/tfjs-node' module.导入“@tensorflow/tfjs-node”模块时出现错误。 My problem is similar to that mentioned in Cannot import @tensorflow/tfjs-node in nodejs我的问题类似于Cannot import @tensorflow/tfjs-node in nodejs中提到的问题

TensorFlow.js version- 1.7.3 TensorFlow.js 版本- 1.7.3

Platform informations: Windows 8.1 Python 2.7.12 npm 6.14.4 node 10.20.1平台信息:Windows 8.1 Python 2.7.12 npm 6.14.4 节点 10.20.1

Package.json is as follows:
{
  "name": "tf",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@tensorflow/tfjs": "^1.7.3",
    "@tensorflow/tfjs-node": "^1.7.3"
  }
}

And the script is a simple one shown below:脚本很简单,如下所示:

console.log("HI");
const tf= require('@tensorflow/tfjs');
require('@tensorflow/tfjs-node');

// Train a simple model:
const model = tf.sequential();
model.add(tf.layers.dense({units: 100, activation: 'relu', inputShape: [10]}));
model.add(tf.layers.dense({units: 1, activation: 'linear'}));
model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});

const xs = tf.randomNormal([100, 10]);
const ys = tf.randomNormal([100, 1]);

model.fit(xs, ys, {
  epochs: 100,
  callbacks: {
    onEpochEnd: (epoch, log) => console.log(`Epoch ${epoch}: loss = ${log.loss}`),
  }
});

Although the file is there already in the path C:\Program Files\nodejs\tf\node_modules@tensorflow\tfjs-node\lib\napi-v5\tf js_binding.node see the image below for your reference.尽管该文件已经存在于路径 C:\Program Files\nodejs\tf\node_modules@tensorflow\tfjs-node\lib\napi-v5\tf js_binding.node 中,但请参阅下图以供参考。

在此处输入图像描述 Need ways to fix it.需要方法来解决它。 Thanks.谢谢。

After doing several things, I decided to remove nodeJs fully and do a fresh install of a higher version (v14.1.0 was available but I installed v12.16.3 instead).在做了几件事之后,我决定完全删除 nodeJs 并重新安装更高版本(v14.1.0 可用,但我安装了 v12.16.3)。 Thankfully I did not have many dependent work using node modules.谢天谢地,我没有很多使用节点模块的依赖工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到 \node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node - Cant find \node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node 无法在 nodejs 中导入 @tensorflow/tfjs-node - Cannot import @tensorflow/tfjs-node in nodejs 节点 Nodemon 错误:找不到模块 'C:\\Program Files\\nodejs\\node_modules\\nodemon\\bin\\' - Node Nodemon Error: Cannot find module 'C:\Program Files\nodejs\node_modules\nodemon\bin\' 找不到模块'E:\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node' - Cannot find module 'E:\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node' 找不到模块“/home/container/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node” - Cannot find module '/home/container/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node' 错误:尝试运行 npm 时找不到模块“C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js” - Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js' when trying to run npm node_modules 中的节点 js MODULE_NOT_FOUND 错误 - node js MODULE_NOT_FOUND error in node_modules 无法“ npm install @ tensorflow / tfjs-node” - Unable to “npm install @tensorflow/tfjs-node” 无法使用 npm 安装 @tensorflow/tfjs-node - Unable to install @tensorflow/tfjs-node with npm 节点 Nodemon 错误:找不到模块 'C:\Program Files\Git\node_modules\nodemon\bin\nodemon.js' - Node Nodemon Error: Cannot find module 'C:\Program Files\Git\node_modules\nodemon\bin\nodemon.js'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM