0

I'm trying to run tensorflow/tfjs-examples/mnist-node on Windows with GPU.

After cloning the repository and installing the dependencies, I can run the example with CPU. However, when I tried to install @tensorflow/tfjs-node-gpu and run the example, here's what I get:

Registration of backend tensorflow failed
Error: The specified module could not be found.    
\\?\C:\Users\noob\Desktop\tfjs-examples\mnist-node\node_modules\@tensorflow\tfjs-node-gpu\build\Release\tfjs_binding.node
    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:20:18)
    at bindings (C:\Users\noob\Desktop\tfjs-examples\mnist-node\node_modules\bindings\bindings.js:81:44)
    at C:\Users\noob\Desktop\tfjs-examples\mnist-node\node_modules\@tensorflow\tfjs-node-gpu\dist\index.js:10:60
    at Environment.registerBackend (C:\Users\noob\Desktop\tfjs-examples\mnist-node\node_modules\@tensorflow\tfjs-core\dist\environment.js:188:27)
    at Object.<anonymous> (C:\Users\noob\Desktop\tfjs-examples\mnist-node\node_modules\@tensorflow\tfjs-node-gpu\dist\index.js:9:9)

According to tfjs-node, it seems like I've already fit the requirements. Here's my environments:

Environment:

  • node v10.9.0

  • nvcc 9.2 V9.2.148

  • Windows 10 version 1803 build 17738.1000

1 Answer 1

1

OK, Problem solved. I have to install CUDA v9.0 instead of v9.2. After uninstall and reinstall it works again.

Here's some tutorial if someone have similar problem.

  1. First download CUDA 9.0 and cuDNN v7 for CUDA 9.0, install CUDA 9.0.

  2. Extract cuDNN files to your CUDA installation folder. (Default to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0)

  3. Add C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin and C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64 to PATH.

  4. run node main in tfjs-examples\mnist-node, it would work now.

At the first time, it may take about 2~5 minutes stuck at Adding visible gpu devices: 0, just wait for it. I'll work.

BTW, you cannot use GPU in WSL mode yet.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.