每次我尝试导入它时都会给我一个错误,如果我有一个包含导入库的任何行的文件
const tf = require("@tensorflowjs/tfjs-node");
或者
const tf = require("@tensorflowjs/tfjs");
require("@tensorflowjs/tfjs-node");
并尝试运行它,它总是给我同样的错误:
node:internal/modules/cjs/loader:1183
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: A dynamic link library (DLL) initialization routine failed.
\\?\(PROJECT DIRECTORY)\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> ((PROJECT DIRECTORY)\node_modules\@tensorflow\tfjs-node\dist\index.js:68:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_DLOPEN_FAILED'
}
版本:
- 节点 v16.6.1
- @tensorflowjs/tfjs ^3.8.0
- @tensorflowjs/tfjs-node ^3.8.0
帮助 :(