gpt4 book ai didi

node.js - 后端tensorflow初始化失败错误: Could not locate the bindings file

转载 作者:搜寻专家 更新时间:2023-11-01 00:48:11 26 4
gpt4 key购买 nike

我在 ubuntu 机器上尝试使用 tensorflow 时收到此错误。这是新文件夹中的全新 npm 安装。我已经尝试了其他帖子的建议,但仍然无法理解。有什么我想念的吗?

Initialization of backend tensorflow failed Error: Could not locate the bindings file. Tried: → /var/nodejs/tensor/node_modules/@tensorflow/tfjs-node/build/tfjs_binding.node, ... etc

Node :v10.12.0

npm: 6.7.0

package.json

{
"name": "tensor",
"scripts": {
"start": "node algo.js"
},
"dependencies": {
"@tensorflow/tfjs-node": "*"
}
}

算法.js

const tf = require('@tensorflow/tfjs-node');

最佳答案

以下步骤之一可能有助于解决您的问题:

  • 干净安装您的依赖项
    • 删除node_modules文件夹
    • 重新运行 npm install
  • (重新)安装 node-gyp:
    • sudo npm install -g node-gyp
  • 通过 sudo 安装依赖项
    • sudo npm install
    • 如果此步骤有效,很可能是您的目录结构存在权限问题。您可能想查看 this question关于如何解决问题。

关于node.js - 后端tensorflow初始化失败错误: Could not locate the bindings file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56092265/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com