Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation works for tfjs-node but failed for tfjs-node-gpu #1098

Closed
steviejsutanto opened this issue Jan 16, 2019 · 14 comments
Closed

Installation works for tfjs-node but failed for tfjs-node-gpu #1098

steviejsutanto opened this issue Jan 16, 2019 · 14 comments
Assignees

Comments

@steviejsutanto
Copy link

steviejsutanto commented Jan 16, 2019

I got this error when installing npm i @tensorflow/tfjs-node-gpu that some people have also gotten. I've tried the solutions that worked for most people, but still nothing worked for me.

I tried npm i -g --production windows-build-tools , also locally. I tried installing windows-build-tools manually as followed from the node-gyp github page.

I tried to install the CPU (npm i @tensorflow/tfjs-node) version and it was installed with no problems.

I have CUDA, CuDNN, etc installed as instructed.

I would really appreciate if someone could help me out with this.

Windows 10
Python 2.7.15
Node v10.15.0
npm v6.4.1
node-gyp 3.8.0

C:\Program Files\tensorflowjs>npm install @tensorflow/tfjs-node-gpu

> @tensorflow/tfjs-node-gpu@0.2.3 install C:\Program Files\tensorflowjs\node_modules\@tensorflow\tfjs-node-gpu
> node scripts/install.js gpu download

* Downloading libtensorflow
[==============================] 13637487/bps 100% 0.0s
* Building TensorFlow Node.js bindings
C:\Program Files\tensorflowjs\node_modules\@tensorflow\tfjs-node-gpu\scripts\install.js:171
      throw new Error('node-gyp rebuild failed with: ' + err);
      ^

Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\tensorflowjs\node_modules\@tensorflow\tfjs-node-gpu
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

    at cp.exec (C:\Program Files\tensorflowjs\node_modules\@tensorflow\tfjs-node-gpu\scripts\install.js:171:13)
    at ChildProcess.exithandler (child_process.js:301:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
npm WARN enoent ENOENT: no such file or directory, open 'C:\Program Files\tensorflowjs\package.json'
npm WARN tensorflowjs No description
npm WARN tensorflowjs No repository field.
npm WARN tensorflowjs No README data
npm WARN tensorflowjs No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs-node-gpu@0.2.3 install: `node scripts/install.js gpu download`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @tensorflow/tfjs-node-gpu@0.2.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\p7545\AppData\Roaming\npm-cache\_logs\2019-01-16T11_50_24_972Z-debug.log
@amcelroy
Copy link

Is there a way to keep the .staging folder and @tensorflow/tfjs-node-gpu folder to help debugging out? Attached in is the log generated by the script, but I'm not sure how to dig deeper as all the scripts are cleaned up upon failure. I can post the --verbose log if needed, but it looks to have found all the correct paths and re-installing windows-build-tools didn't help.

2019-01-19T20_11_19_631Z-debug.log

@amcelroy
Copy link

Another update: npm install --verbose @tensorflow/tfjs-node-gpu@0.2.1 works on my machine, but not 0.2.0, 0.2.2, or 0.2.3

@nkreeger
Copy link
Contributor

Those logs have a truncated node-gyp log so it is hard to figure out what is going on.

Do you mind cloning the tfjs-node repo and running the following - it might give some more details:

git clone https://github.com/tensorflow/tfjs-node.git
cd tfjs-node
npm install

# This command probably fails:
npm run enable-gpu

# Get the logs from this:
node-gyp rebuild

If you don't have node-gyp - npm install -g node-gyp.

Also one other question - which version of CUDA/CUDNN do you have - we have strict requirements that match TensorFlow 1.12: https://www.tensorflow.org/install/gpu

@amcelroy
Copy link

PS C:\Users\mcelr\tfjs-node> node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@11.4.0 | win32 | x64
gyp info spawn c:\python27\python.EXE
gyp info spawn args [ 'C:\Users\mcelr\AppData\Roaming\npm\node_modules\node-gyp\gyp\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=2015',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\mcelr\tfjs-node\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\mcelr\AppData\Roaming\npm\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\mcelr\.node-gyp\11.4.0\include\node\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\mcelr\.node-gyp\11.4.0',
gyp info spawn args '-Dnode_gyp_dir=C:\Users\mcelr\AppData\Roaming\npm\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\Users\mcelr\.node-gyp\11.4.0\<(target_arch)\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\Users\mcelr\tfjs-node',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\Users\mcelr\tfjs-node\build',
gyp info spawn args '-Goutput_dir=.' ]
Warning: Missing input files:
C:\Users\mcelr\tfjs-node\deps\include\tensorflow\c\c_api.h
C:\Users\mcelr\tfjs-node\deps\include\tensorflow\c\eager\c_api.h
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
deps-stage
generate_def
fs.js:121
throw err;
^

CUSTOMBUILD : error : ENOENT: no such file or directory, open 'C:\Users\mcelr\tfjs-node/deps/include/tensorflow/c/c_
api.h' [C:\Users\mcelr\tfjs-node\build\tfjs_binding.vcxproj]
at Object.openSync (fs.js:450:3)
at Object.readFileSync (fs.js:350:35)
at files.map (C:\Users\mcelr\tfjs-node\scripts\generate_defs.js:23:40)
at Array.map ()
at Object. (C:\Users\mcelr\tfjs-node\scripts\generate_defs.js:23:23)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\mcelr\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "c:\program files\nodejs\node.exe" "C:\Users\mcelr\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\mcelr\tfjs-node
gyp ERR! node -v v11.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not o

@nkreeger
Copy link
Contributor

You need to run yarn or npm install first - that will download the missing dependencies.

@saravanabalagi
Copy link

Any luck building v1.0.1 with GPU support?

I tried on

  • Win 10 (10.0.17134)
  • Python 2.7.13
  • Node 8.12.0
  • npm 6.4.1
  • Build Tools 2017 (v15)
PS F:\Projects\js\mnist-node> node-gyp configure --verbose
gyp info it worked if it ends with ok
gyp verb cli [ 'F:\\JS\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'configure',
gyp verb cli   '--verbose' ]
gyp info using node-gyp@3.8.0
gyp info using node@8.12.0 | win32 | x64
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed  python2 { Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed   stack: 'Error: not found: python2\n    at getNotFoundError (C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\node_modules\\which\\which.js:13:12)\n    at F (C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\node_modules\\which\\which.js:68:19)\n    at E (C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\node_modules\\which\\which.js:80:29)\n    at C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\node_modules\\which\\which.js:89:16\n    at C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\node_modules\\isexe\\index.js:42:5\n    at C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\node_modules\\isexe\\windows.js:36:5\n    at FSReqWrap.oncomplete (fs.js:152:21)',
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python F:\Ruby\python\python.EXE
gyp verb check python version `F:\Ruby\python\python.EXE -c "import sys; print "2.7.13
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 8.12.0
gyp verb command install [ '8.12.0' ]
gyp verb install input version string "8.12.0"
gyp verb install installing version: 8.12.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.12.0
gyp verb build dir attempting to create "build" dir: F:\Projects\js\mnist-node\build
gyp verb build dir "build" dir needed to be created? null
gyp verb find vs2017 Found installation at: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.Windows10SDK.17763
gyp verb find vs2017   - Found Microsoft.VisualStudio.Component.VC.Tools.x86.x64
gyp verb find vs2017   - Found Microsoft.VisualStudio.VC.MSBuild.Base
gyp verb find vs2017   - Using this installation with Windows 10 SDK
gyp verb find vs2017 using installation: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: F:\Projects\js\mnist-node\build\config.gypi
gyp verb config.gypi checking for gypi file: F:\Projects\js\mnist-node\config.gypi
gyp verb common.gypi checking for gypi file: F:\Projects\js\mnist-node\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn F:\Ruby\python\python.EXE
gyp info spawn args [ 'C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=2015',
gyp info spawn args   '-I',
gyp info spawn args   'F:\\Projects\\js\\mnist-node\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Zeke\\.node-gyp\\8.12.0\\include\\node\\common.gypi',gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Zeke\\.node-gyp\\8.12.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Zeke\\.node-gyp\\8.12.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=F:\\Projects\\js\\mnist-node',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'F:\\Projects\\js\\mnist-node\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: F:\Projects\js\mnist-node) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Zeke\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "F:\\JS\\nodejs\\node.exe" "C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--verbose"
gyp ERR! cwd F:\Projects\js\mnist-node
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not

Also tried the same with Build Tools 2015 (v14), but I get the same error. All tfjs-node cpu versions are built without any errors.

tfjs-node-gpu builds only if I force the version to 0.2.1 and gives errors on other versions (0.2.3, )1.0.1

@nkreeger
Copy link
Contributor

Your system is not finding python2 - try the instructions here https://github.com/tensorflow/tfjs-node/blob/master/WINDOWS_TROUBLESHOOTING.md#missing-python2

@ecounce
Copy link

ecounce commented Mar 14, 2019

I suggest setting NODE_OPTIONS environment to increase memory limit. I had success building tfjs-node v1.0.1 with GPU support on Windows 10/Build Tools 2015 using"NODE_OPTIONS=--max-old-space-size=4096"

@saravanabalagi
Copy link

@nkreeger

But it seems it has found it after searching in PATH

gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python F:\Ruby\python\python.EXE
gyp verb check python version `F:\Ruby\python\python.EXE -c "import sys; print "2.7.13

I also made sure I can call python (python27) in cmd, is there anything else I need to do?

@saravanabalagi
Copy link

saravanabalagi commented Mar 14, 2019

Noticed that in my previous message the error was gyp file was missing. In fact there was no gyp file in the directory mnist-node from examples.

Is that the expected behaviour?
Are all repos that use tfjs-node-gpu required to have a gyp bindings file?

@saravanabalagi
Copy link

So I tried yarn and yarn enable-gpu on the clone of this repo itself (which had the gyp file and the bindings). But even then I got build failed error. This time, I also tried adding python2 to PATH in addition to python (both being v2.7.13). Again build failed at MSBuild: msbuild.exe from the windows build tools (2017/v15) that I installed.

I tried further with Build Tools 2015 (v14) and got

yarn run v1.13.0
$ node scripts/install.js gpu download && yarn
* Downloading libtensorflow
[==============================] 23878484/bps 100% 0.0s
[==============================] 2471979/bps 100% 0.0s
* Building TensorFlow Node.js bindings
F:\Projects\js\tfjs-node\scripts\install.js:165
      throw new Error('node-gyp rebuild failed with: ' + err);
      ^

Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@8.12.0 | win32 | x64
gyp info spawn F:\Ruby\python\python2.EXE
gyp info spawn args [ 'F:\\JS\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'F:\\Projects\\js\\tfjs-node\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'F:\\JS\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Zeke\\.node-gyp\\8.12.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Zeke\\.node-gyp\\8.12.0',
gyp info spawn args   '-Dnode_gyp_dir=F:\\JS\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Zeke\\.node-gyp\\8.12.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=F:\\Projects\\js\\tfjs-node',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'F:\\Projects\\js\\tfjs-node\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (F:\JS\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "F:\\JS\\nodejs\\node.exe" "F:\\JS\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd F:\Projects\js\tfjs-node
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

    at cp.exec (F:\Projects\js\tfjs-node\scripts\install.js:165:13)
    at ChildProcess.exithandler (child_process.js:283:5)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

And node-gpy configure --verbose output was

gyp info it worked if it ends with ok
gyp verb cli [ 'F:\\JS\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'configure',
gyp verb cli   '--verbose' ]
gyp info using node-gyp@3.8.0
gyp info using node@8.12.0 | win32 | x64
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 F:\Ruby\python\python2.EXE
gyp verb check python version `F:\Ruby\python\python2.EXE -c "import sys; print "2.7.13
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 8.12.0
gyp verb command install [ '8.12.0' ]
gyp verb install input version string "8.12.0"
gyp verb install installing version: 8.12.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.12.0
gyp verb build dir attempting to create "build" dir: F:\Projects\js\tfjs-node\build
gyp verb build dir "build" dir needed to be created? null
gyp verb Not using VS2017: No usable installation of VS2017 found
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: F:\Projects\js\tfjs-node\build\config.gypi
gyp verb config.gypi checking for gypi file: F:\Projects\js\tfjs-node\config.gypi
gyp verb common.gypi checking for gypi file: F:\Projects\js\tfjs-node\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn F:\Ruby\python\python2.EXE
gyp info spawn args [ 'C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'F:\\Projects\\js\\tfjs-node\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Zeke\\.node-gyp\\8.12.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Zeke\\.node-gyp\\8.12.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Zeke\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Zeke\\.node-gyp\\8.12.0\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=F:\\Projects\\js\\tfjs-node',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'F:\\Projects\\js\\tfjs-node\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

@nkreeger
Copy link
Contributor

@saravanabalagi Sadly, the node-gyp build tool uses gyp which has had various issues (just search issues on that repo) keeping up with Visual Studio build tool updates. Chrome moved away from gyp to gn a couple of years ago. While there are efforts underway to help, it's probably best for us to start providing users with pre-built binaries (at least on Windows to start).

Please follow this issue: #1390

@adwellj
Copy link

adwellj commented Apr 11, 2019

@nkreeger, FWIW, I finally got tfjs-node-gpu to install on Win10. I had to install version 0.3.2 for it to work. Trying any of the 1.0.x versions would result in the above mentioned node-gyp rebuild failures.

Any possibility that this is a similar issue to the gpu packaging / layout issue with the upstream version of TF?
Where it was discovered in 0.2.2 - 0.3.0: #1121 (comment)
Where you fixed it for 0.3.1: tensorflow/tfjs-node#208

@kangyizhang
Copy link
Contributor

With the latest tfjs-node/tfjs-node-gpu package, we are shipping pre-compile addon and there should be no compilation on your machine. This issue should have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants