-
Notifications
You must be signed in to change notification settings - Fork 2k
Cannot import @tensorflow/tfjs-node-gpu on Windows #2003
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
Comments
hi @Mobles, quick question: are you seeing the same issue when using @tensorflow/tfjs-node package? |
@kangyizhang Nope, that works fine, I have had that issue when using it once but I fixed it by doing This doesn't fix it for tfjs-node-gpu though :/ |
hi @Mobles Other users has the same issue and I'm dedicated to fixing it. However I can not reproduce it on my windows machine, I need some of your help. Can you
Thank you! |
bindingPath: D:\Programming\NodeJS Work\dumb-doorbell\server\test\tfjs\tfjs-node\lib\napi-v4\tfjs_binding.node The tests failed anyhow
|
Thanks a lot for the update! The path looks fine. And if the test could start, the module could be loaded correctly. The problem should be related with the published npm package. I'll look into it. FYI the failed test is unrelated. |
Ah okay, thanks for the assistance ! |
@Mobles I can reproduce the issue. It's because of the space in your path. Space in path is not supported by the binding tool node-gyp. Please try to move it to a folder without space and let me know if the error still exist. |
Nope, same error, no spaces in my file path
|
@Mobles did you delete node_module and reinstall dependencies? |
Yup, I deleted the folder and typed |
@Mobles can you try go to the @tensorflow/tfjs-node-gpu directory, like |
@Mobles I can not reproduce the error on my machine but another user says removing |
Hi @kangyizhang Both the above solutions didn't work, the first one gave me this error:
and the second one the same error still persists, removing the - didn't help Ignore the above error, fixed it by installing node-gyp globally! Didn't fix it though |
@kangyizhang, I'm in the same boat.
This is also after trying your suggestion of Please let me know if there's anything I can do to assist in troubleshooting. |
@Mobles I still can not reproduce this error, but I found this question. Can you follow the answer in this question and install windows-build-tools, then try again? @adwellj can you try to 1) see if it works after remove |
@kangyizhang Nope, didn't fix it, the windows-build-tools wouldn't install for a good hour, just this message
So I cancelled it, and tried again and it installed but running my program again didn't work and got the same error. Just saw the Dependancy Walker comment, got this
Andddd I'm missing a ton of modules: Any particular package that has all of these in? |
@kangyizhang tried it in a brand new repo without any hyphens in the name. Same result. @Mobles for reference, I'm using CUDA toolkit 10.0.130 and cuDNN 10.0 version 7.4.2.24.
Hopefully this will be of benefit to you :) Creating a new project with a hyphen in the name:
Edit: Corrected cuDNN version from 7.6 to 7.4 |
I had already got those path variables, They didn't help though, I'm going to try reinitalize my project, see what that does. Edit: Nope, same error :/
|
@Mobles bummer :( Have you tried creating a new project with only tfjs-node-gpu to isolate it down to just this package? |
@adwellj |
@Mobles unsure if this is relevant, but here are some additional things I had done previously to this new PC. They're steps that I used to have to do for version 0.3.2 when tfjs-node-gpu was using node-gyp to build on the client.
My understanding is that node-gyp is no longer needed, so this is likely not relevant, but these are some other configurations that I've made to this new machine. |
@Mobles can you try with CUDA 10.0 and cuDNN >= 7.4.1? These are the official supported version: https://www.tensorflow.org/install/gpu |
Good catch @kangyizhang! I didn't notice the 10.1 in his path variables. FYI, cuDNN version 7.6.2.24 does not work. It will generate a 'could not create cudnn handle' exception once I try to perform some operations. I just found that out about an hour ago 😏 |
Hi @kangyizhang That unfortunately didn't help :/ Same error
|
Right, turns out I fixed it? Some how??? Idk how I did but it had nothing to do with NodeJS? I was looking at Voice Mimicing with AI, installed some Python 3.7 libraries, one of which being Tensorflow GPU & PyTorch, now it's suddenly working I legit have 0 clue as to what got it working :/ |
I've also been having this problem, it seems to be related to the Node version installed. When I run
It seems like some of the output didn't render properly (there were some blank lines) but it looks the same as @ealionel's output. However, if I uninstall Node v12.13 and install Node v11.15 instead, it runs the tests:
I think that it is also broken in Node v10. |
hi @ealionel I can reproduce the error on a new windows machine (though it works on the windows machine we use to develop). I'll try to figure out the reason. |
@DouglasLivingstone do you see the same error with tfjs-node for version 1.2.9 or 1.2.10? |
I'm having the exact same issue on a new Windows machine under Node v12.13.0. I've installed Python 2 and the dev tools with absolutely no problems. I can build the bindings and can confirm that they exist, but I get the same import error. This is with TFJS-Node version 1.3.1. On my other system, I managed to get it to work perfectly with Node v10.16.3, TFJS v1.2.11 and TFJS-Node v1.2.9. I've no idea why this worked, and trying to update any packages results in the "module not found" issue for "tfjs_binding.node". Both of these systems are on Windows 10 1903. |
I too had problems running newer versions of tfjs on newer versions of Node on Windows 10. Node v10.17.0 and tfjs 1.2.11 would produce a 'module not found' error when trying to |
I have the same error running [email protected] with node 12.13.0. |
Hi, same error here on Windows 10 as well:
Node version: 12.13.1 Side note: I can't install [email protected], even if I have tried installing (and reinstalling) |
@MarcDelp, I'm pretty sure there's an issue with tfjs and node 12, and the latest version of node to be working is 10.16.3. Perhaps try with node 10.16.3 and see if that temporarily resolves your issue. |
Yes, I got it working on node 10.16.3 with tfjs 1.3.1 but I'd really like to make it on node 12 as we are starting a new project from scratch. Do you have any idea (even if not a precise one) on when the fix may be available? |
If this problem is still affecting anyone, I think I might've found a temporary fix. I transplanted the tensorflow.dll file from my Node v10.16.3 modules (node_modules@tensorflow\tfjs-node\lib\napi-v4) to my Node 12 modules which didn't seem to have one. Then, I got past the "specified module could not be found" error. This is quite a bad bodge and definitely not a solution for production environments but seems to work fine for development until this issue is fixed. The DLL file is hosted here, if you can't find it. |
This issue should have been fixed @v1.4.0 and later. Please feel free to let me know if you are still seeing any error. |
Yeah, sorry, it has been fixed, I was still on an old version. Thanks for the update 😁. |
@kangyizhang Still the same error "Error: Cannot find module '.../node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node'" macOS Catalina node -v "name": "@tensorflow/tfjs-node", "name": "@tensorflow/tfjs", "name": "@tensorflow/tfjs-core", |
OK, binary searching :( versions I came to the latest working solution: node -v "name": "@tensorflow/tfjs-node", Obviously, this is far from ideal as we need to propagate node version changes on the production servers, and as we have both frontend and backend tf, we need to reduce frontend version to not risk compatibility issues or keep them version-async we are happy to create minimal test case and provide whatever info to be able to work with the latest versions of tf and node |
It is even worse with our servers, @kangyizhang Here is the server info Ubuntu 18.04.4 LTS |
I've recently found that starting with node 12.15, you need to be on tfjs-node-gpu 1.5.x. Below 12.15 requires 1.4.0 (or below). Also, tfjs-node-gpu 1.5.x requires CuDNN 7.6, whereas earlier versions used 7.4. I hope this helps you guys. The poor / incomplete documentation regarding version compatibility is frustrating. |
Thanks, @adwellj, it is a regular server, without GPU server, as there is no demanding TF use case. I tried various combinations, but I couldn't find a working option, I started with the latest versions of nodes and tfjs, but then followed various suggestions with using earlier versions. With OSX it helped, but Ubuntu is even worse EDIT: With the latest v1.7.0 Ubuntu is resolved. I get expected warning :) "Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA" |
\?\C:\Users\eddie\Documents\GitHub\Y8-Instant-io-Game\node_modules@tensorflow\tfjs-node\lib\napi-v5\tfjs_binding.node Works fine on a clean install but on a machine that has had many versions of node, getting some extra slashes |
Thanks @JoshNewham1, save my project =D |
I would like to underline the fact that this problem is not resolved. I've tried everything mentioned above without any success to get tjfs-node-gpu working on windows 10. It always yields It feels like finding right versions of node.js + tfjs + tfjs-node-gpu is purely experimental task which is a little frustrating. Also I have to mention that tfjs works well on CPU. UPDATE:
The final set of configurations working for me seem to be following: And don't forget adding required CUDA paths into env PATH. |
I am getting the same issue with both tfjs-node and tfjs-node-gpu, some of previous versions were running properly, but are not working now. Versions of my system: Please help |
To get help from the community, we encourage using Stack Overflow and the
tensorflow.js
tag.TensorFlow.js version
1.2.9
Browser version
Using NodeJS: v12.10.0
Describe the problem or feature request
Cannot import @tensorflow/tfjs-node-gpu at all, only @tensorflow/tfjs-node but I'd like to use my GPU.
Code to reproduce the bug / link to feature request
require('@tensorflow/tfjs-node-gpu');
Here is the error:
`internal/modules/cjs/loader.js:977
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: The specified module could not be found.
\?\D:\Programming\NodeJS Work\dumb-doorbell\server\node_modules@tensorflow\tfjs-node-gpu\lib\napi-v4\tfjs_binding.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:977:18)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Module.require (internal/modules/cjs/loader.js:830:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object. (D:\Programming\NodeJS Work\dumb-doorbell\server\node_modules@tensorflow\tfjs-node-gpu\dist\index.js:44:16)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
`
I've tried reinstalling all my modules, tried using Recommended Node version, tried rebuilding the package, idk what else to try so I'm hoping to get some way to fix this from here
The text was updated successfully, but these errors were encountered: