Day045 — install tensorflow-gpu

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

Installing TensorFlow on Windows | TensorFlow

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-toolkit
ImportError: 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.

cuDNN Installation Guide :: Deep Learning SDK Documentation

After all that, a tensorflow program should works perfectly.

Source: Deep Learning on Medium