我已经安装了 Visual Studio 2019 以及 C++ 工作负载的桌面开发。我还在我的 Windows 机器上设置了 CUDA。
当我尝试安装 tfjs-node-gpu 时,我在下面粘贴了错误。(我刚刚用 {project-directory} 替换了我的实际项目路径)
任何帮助将不胜感激,谢谢
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js gpu download
npm ERR! GPU-windows-3.9.0.zip
npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-windows-x86_64-2.5.0.zip
npm ERR! node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.4
npm ERR! node-pre-gyp info using node@12.16.1 | win32 | x64
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 6
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 7
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 8
npm ERR! node-pre-gyp info check checked for "{project-directory}\node_modules\@tensorflow\tfjs-node-gpu\lib\napi-v5\tfjs_binding.node" (not found)
npm ERR! node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v5/3.9.0/GPU-windows-3.9.0.zip
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v5/3.9.0/GPU-windows-3.9.0.zip
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/tfjs-node-gpu@3.9.0 and node@12.16.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v5/3.9.0/GPU-windows-3.9.0.zip
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@12.16.1 | win32 | x64
npm ERR! gyp info ok
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 6
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 7
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 8
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@12.16.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.6.8 found at "C:\Users\Hammaad\AppData\Local\Programs\Python\Python36\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.31727.386) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\Hammaad\AppData\Local\Programs\Python\Python36\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\Hammaad\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '{project-directory}\\node_modules\\@tensorflow\\tfjs-node-gpu\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Hammaad\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Hammaad\\AppData\\Local\\node-gyp\\Cache\\12.16.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\Hammaad\\AppData\\Local\\node-gyp\\Cache\\12.16.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Hammaad\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Hammaad\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\12.16.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir={project-directory}\\node_modules\\@tensorflow\\tfjs-node-gpu',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args '{project-directory}\\node_modules\\@tensorflow\\tfjs-node-gpu\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info ok
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 6
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 7
npm ERR! node-pre-gyp info This Node instance does not support builds for Node-API version 8
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.2.0
npm ERR! gyp info using node@12.16.1 | win32 | x64
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Users\Hammaad\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:311:20)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Hammaad\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module={project-directory}\\node_modules\\@tensorflow\\tfjs-node-gpu\\lib\\napi-v5\\tfjs_binding.node" "--module_name=tfjs_binding" "--module_path={project-directory}\\node_modules\\@tensorflow\\tfjs-node-gpu\\lib\\napi-v5" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=5" "--node_napi_label=napi-v5"
npm ERR! gyp ERR! cwd {project-directory}\node_modules\@tensorflow\tfjs-node-gpu
npm ERR! gyp ERR! node -v v12.16.1
npm ERR! gyp ERR! node-gyp -v v8.2.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Hammaad\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module={project-directory}\node_modules\@tensorflow\tfjs-node-gpu\lib\napi-v5\tfjs_binding.node --module_name=tfjs_binding --module_path={project-directory}\node_modules\@tensorflow\tfjs-node-gpu\lib\napi-v5 --napi_version=5 --node_abi_napi=napi --napi_build_version=5 --node_napi_label=napi-v5' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> ({project-directory}\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (events.js:311:20)
npm ERR! node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19043
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "{project-directory}\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd {project-directory}\node_modules\@tensorflow\tfjs-node-gpu
npm ERR! node-pre-gyp ERR! node -v v12.16.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.4
npm ERR! node-pre-gyp ERR! not ok
npm ERR! * Downloading libtensorflow
npm ERR!
npm ERR! * Building TensorFlow Node.js bindings