Tensorflow can't find "cudart64_90.dll" even though it is installed with Path variable set

I found the solution. And it was the good old advice - "Have you tried turning it off and on again?"

I restarted the computer, Tensorflow found cudart64_90.dll, but now it could not find cudnn64_7.dll. I'm providing the steps ahead to get rid of the issues I encountered.


If you've installed Tensorflow GPU version, you're likely to run into the problem mentioned in the post. Especially if you've not installed NVDIA development toolkits before. Follow these steps:

1. Install CUDA

Get it from here. Install only the version mentioned in Tensorflow's ImportError.

ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit

It explicitly tells you the version number. Initially, I installed CUDA 9.1 instead of 9.0, it didn't work. The installation on Windows is straight forward. Run the .exe, uncheck NVIDIA Geforce and other packages if you already have them installed.

2. Include CUDA path in PATH variable

Point it to the bin directory of your tensorflow installation. Check here if you don't know how to set the PATH variable. Now try importing Tensorflow, if it still doesn't work, try rebooting the system.

Now you will likely run into the error:

ImportError: Could not find 'cudnn64_7.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 7 from this URL: https://developer.nvidia.com/cudnn

3. Install cuDNN

Once again, only install the version mentioned in the error.To get the installer, you need to have an NVIDIA developer account. If you don't have it, sign up and it will direct you to the link to download cuDNN. Select the version compatible with your CUDA version (it's in the package name). Download the zip archive. Extract it somewhere on your disk.

4. Include cuDNN path in PATH variable

Similar to step two. This time, point it to the bin directory in your extracted archive of cuDNN. Now import Tensorflow. Restart system if required.

It should now work.

Tags:

Tensorflow