question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't install @tensorflow/tfjs-node-gpu

See original GitHub issue

TensorFlow.js version

Successfully installed: @tensorflow/tfjs-node@0.1.11 MacOS X 10.12.5 node v9.4.0

Describe the problem or feature request

When I run any node.js app that using tfjs I get:

============================ Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require(‘@tensorflow/tfjs-node’); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.

But I’ve already have installed @tensorflow/tfjs-node@0.1.11 and it works fine. But when I try to install tfjs-node-gpu I get a message:

$ npm i @tensorflow/tfjs-node-gpu

> @tensorflow/tfjs-node-gpu@0.1.11 install /Users/user/node-projects/node_modules/@tensorflow/tfjs-node-gpu
> node-gyp rebuild

  ACTION binding_gyp_tfjs_binding_target_download_libtensorflow Release/libtensorflow.so
Please submit a valid platform
make: *** [Release/libtensorflow.so] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Darwin 16.6.0
gyp ERR! command "/usr/local/Cellar/node/9.4.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/node-projects/node_modules/@tensorflow/tfjs-node-gpu
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/user/node-projects/package.json'
npm WARN NewATHSignals No description
npm WARN NewATHSignals No repository field.
npm WARN NewATHSignals No README data
npm WARN NewATHSignals No license field.

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

Code to reproduce the bug / link to feature request

$ npm i @tensorflow/tfjs-node-gpu

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nkreegercommented, Aug 11, 2018

We don’t ship a pre-built libtensorflow for Mac OS that has CUDA support. You can roll your own by:

  1. Building libtensorflow with CUDA for Mac: https://www.tensorflow.org/install/install_sources

Bazel build target:

bazel build --config=monolithic //tensorflow/tools/lib_package:libtensorflow
  1. Updating the get_libtensorflow.js script to use your pre-built binary: https://github.com/tensorflow/tfjs-node/blob/master/scripts/get_libtensorflow.js#L48

3.) Re-building using yarn.

We don’t officially support Mac OS + GPU builds today. However, we are accepting patches to enable this functionality 😃

0reactions
rthadurcommented, Feb 6, 2019

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install tfjs-node or tfjs-node-gpu on Windows 10 #2619
In the lib/napi-v4 folder, it should have tfjs_binding.node file and tensorflow.dll file. tensorflow.dll file is moved from deps/lib folder ...
Read more >
@tensorflow/tfjs-node - npm
Start using @tensorflow/tfjs-node in your project by running `npm i ... npm install @tensorflow/tfjs-node-gpu (or) yarn add ...
Read more >
Unable to install @tensorflow/tfjs-node with npm
I installed it using 'npm install @tensorflow/tfjs-node' but the installations fails. I tried installing 'node-pre-gyp' globally, with and ...
Read more >
Setup | TensorFlow.js
Node.js Setup · Option 1: Install TensorFlow.js with native C++ bindings. tfjs-node · Option 2: (Linux Only) If your system has a NVIDIA®...
Read more >
Unable to install @tensorflow/tfjs-node - General
Hi, I am a beginner to node-red. I have been trying to install the @tensorflow/tfjs-node to node-red. In Winodws cmd and node-red on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found