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
"cpu backend was already registered" during import/require tfjs + tfjs-node-gpu #708
Comments
Any chance you are double-importing https://github.com/tensorflow/tfjs-examples/blob/master/mnist-node/main.js#L18 If you perform any operations on |
@nkreeger nope, I run exactly those two lines in Node. Nothing else. |
Can you post the entire output from node? I wonder if the GPU bindings are failing to load. |
Also can you provide more details - which OS / device / etc? |
GPU bindings load successfully. My device is described in #709 (output from
System:
|
Any news on this one? Need any help? Have exactly same problem on Mac |
We need to update docs - we changed |
@nkreeger How to get |
Just require('@tensorflow/tfjs') The GPU package includes tfjs as well. |
Changing package.json to this: (excluding @tensorflow/tfjs)
Running npm install and using
fixes the issue for me |
@AiBoy Yep - sorry for the confusion. We found it was easier to ship the union tfjs package instead of chasing tfjs-core updates all the time. |
@nkreeger I tried with the most recent versions of the packages and it still does not work for me. If I don't do |
Again: only |
If I do
then Then I do
and |
Hi! |
@signoriello How do you import/require? FWIW this issue is not about not working - it works perfectly, just the warning is printed. |
Currently I am just testing the mnist-node example. In order to require, I use at it was set in the main file |
@vmarkovtsev Try deleting your local |
Same problem gettind it to work on ubuntu 18.04 - node index.js
cpu backend was already registered. Reusing existing backend
Registration of backend tensorflow failed
Error: libcublas.so.9.0: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at bindings (/home/eric/Desktop/MLKits/knn-tf/node_modules/bindings/bindings.js:81:44)
at /home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-node-gpu/dist/index.js:46:60
at Environment.registerBackend (/home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-node-gpu/node_modules/@tensorflow/tfjs-core/dist/environment.js:234:27)
at Object.<anonymous> (/home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-node-gpu/dist/index.js:45:8) Package.json is fine, deleted node modules. installed with tfjs-node-gpu only, it gave: Error: Cannot find module '@tensorflow/tfjs-core'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-data/dist/dataset.js:48:10)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3) It is only working with regular tfjs: require ('@tensorflow/tfjs-node'); Using Dell XPS 15 9570 with gtx 1050ti, nvidia drivers work on this machine in ubuntu 18.04, they are up to date. Just trying to take advantage of gpu for ML. Thanks for all your work! |
This could be an issue with double importing of tfjs. Can you show what your package.json dependencies look like? You don't need to import |
Tensorflow js is only imported once. const tf = require ('@tensorflow/tfjs-node-gpu');
"dependencies": {
"@tensorflow/tfjs-node-gpu": "^0.3.2",
"lodash": "^4.17.11",
"shuffle-seed": "^1.1.6"
}
} returns This is what I get when I just do this, with a working calculation in the file. It stilln runs the calculation, but it seems to still be using the CPU not the GPU: const tf = require('@tensorflow/tfjs-node-gpu'); Registration of backend tensorflow failed
Error: libcublas.so.9.0: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at bindings (/home/eric/Desktop/MLKits/knn-tf/node_modules/bindings/bindings.js:81:44)
at /home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-node-gpu/dist/index.js:46:60
at Environment.registerBackend (/home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-core/dist/environment.js:234:27)
at Object.<anonymous> (/home/eric/Desktop/MLKits/knn-tf/node_modules/@tensorflow/tfjs-node-gpu/dist/index.js:45:8)
TensorFlow.js deprecation warnings have been disabled.
============================
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.
============================ also tested all running as root to no avail. |
Oh, and CUDA Drivers are installed as well as up to date nvidia drivers ( Ubuntu 18.04 ) |
Reopening this due to the recent reports from our users. |
@ericscottmarquez which version of CUDA do you have. We ship TensorFlow 1.12 (soon 1.13.1) and that only supports 9.x. CUDA 10 is not currently supported. |
Using 9x
|
Is there an error dump or something that I could pull from somewhere to send you guys that could help? |
You need CUDA 9.0 right now - sorry for the confusion. |
Hi @dsmilkov I am seeing the same warnings in the console. Although this doesn't affects the functionality but still these are some warnings that appear. |
To summarize:
const tf = require('@tensorflow/tfjs-node');
tf.square(3).print();
const tf = require('@tensorflow/tfjs-node-gpu');
tf.square(3).print(); No need to import If you get Let me know if these instructions are helpful. We can make sure they surface in the README. Thanks everyone for the feedback <3 |
This issue should be ok to close. |
TensorFlow.js version
0.13.0
tfjs-node-gpu 0.1.17
Browser version
N/A - Node 10.10
Describe the problem or feature request
or
print the warning:
It's very minor ofc but damn annoys much.
The text was updated successfully, but these errors were encountered: