Day045 — install tensorflow-gpu

Jacky Tsang
2 min readMar 15, 2018

--

I install tensorflow-gpu on my Windows machine. Here is what I learn from it.

I follow the above instructions to install the tensorflow-gpu python package. There are few things to be noted when installing.

  1. Make sure you have the right version of python. It should be 64-bit version of 3.5.x or 3.6.x as noted in the instruction. Otherwise, you can’t install Tensorflow because it requires 64-bit python.
  2. Install tensorflow-gpu first, then CUDA and cuDNN. After installing tensorflow or tensorflow-gpu, run the provided validation program to check what CUDA and cuDNN version it requires. The latest version of them may not be what you need. For my program to work, it needs tensorflow v1.4.0, which it uses CUDA v8.0 instead of the latest v9.1 and cuDNN v6.0 instead of v7.1. If the wrong version is installed, below error will occur.
ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 8.0 from this URL: https://developer.nvidia.com/cuda-toolkitImportError: Could not find 'cudnn64_6.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 6 from this URL: https://developer.nvidia.com/cudnn

After installing the tensorflow-gpu python package, it is time to install cuDNN and CUDA with below instructions. It should be an easy task.

After all that, a tensorflow program should works perfectly.

To install a specific version of tensorflow, you can simply do this.

$ pip3 install --upgrade tensorflow-gpu==1.4.0

To see what version is available, you can do this.

$ pip3 install --upgrade tensorflow-gpu==Could not find a version that satisfies the requirement tensorflow-gpu== (from versions: 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0)
No matching distribution found for tensorflow-gpu==

--

--

No responses yet