找不到 \node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node [英] Cant find \node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node

查看:48
本文介绍了找不到 \node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试让 tensorflow.js 库工作好几天了.

I have tried to get the tensorflow.js library to work for days now.

我已经在我的电脑上安装了

I have installed on my computer

  • Python 2.7
  • Visual Studio 2019
  • 节点 12.13.0

这是我为产生错误所做的步骤:

This is the steps I've done to produce the error:

  1. 创建空文件夹
  2. npm init 文件夹内
  3. npm install --save @tensorflow/tfjs-node
  4. 创建了一个 index.js 文件
  5. 添加了 1 行:require('@tensorflow/tfjs-node')
  6. 尝试运行 node index.js
  1. Create empty folder
  2. npm init inside the folder
  3. npm install --save @tensorflow/tfjs-node
  4. created a index.js file
  5. added 1 line : require('@tensorflow/tfjs-node')
  6. tried to run node index.js

出现此错误:

C:\Users\kim_1\Desktop\workplz>node index.js
internal/modules/cjs/loader.js:1003
  return process.dlopen(module, path.toNamespacedPath(filename));
             ^

Error: The specified module could not be found.
\\?\C:\Users\kim_1\Desktop\workplz\node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\kim_1\Desktop\workplz\node_modules\@tensorflow\tfjs- 
    node\dist\index.js:44:16)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)

我的 package.json

my package.json

{
  "name": "workplz",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@tensorflow/tfjs-node": "^1.3.0"
  }
}

推荐答案

案例更新:

@tensorflow/tfjs-node@1.3.0 在 Node 版本 12.13.0 上有问题(来源 https://github.com/tensorflow/tfjs/issues/2341)

@tensorflow/tfjs-node@1.3.0 has issues with Node version 12.13.0 (source https://github.com/tensorflow/tfjs/issues/2341)

必须在 Node 版本 10.16.3 中使用 @tensorflow/tfjs-node@1.2.11

Had to use @tensorflow/tfjs-node@1.2.11 with Node version 10.16.3

这篇关于找不到 \node_modules\@tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆