Install Tensorflow GPU on Windows 10

Introduction

Having the intention to share tutorials on tensorflow, I must start from the beginning. Install Tensorflow in GPU for NVIDIA cards.
I had a hell of luck trying to install tensorflow in GPU mode ... Several days wasted ... I first managed this and easily on Ubuntu which remains the environment I will advise in production ... And after having tinkered, I ended up finding a stable solution for Windows 10 on the condition of remaining in specific versions.
In this case the installation that I propose - which is largely sufficient to work professionally on Tensorflow - concerns the following versions:
  • Tensorflow 1.1
  • Cuda 8
  • and all version of CuDnn.
Then at the end of the article I propose a procedure to upgrade to version 1.4 ...

Step 1 - Install Anaconda

Install Anaconda for Python 3.x (current 3.6) https://www.anaconda.com/download/

Step 2 - Install Cuda

In this case, install CUDA 8 and not version 9 (for now). For this go to the archives https://developer.nvidia.com/cuda-toolkit-archive
and download and install version 8 here https://developer.nvidia.com/cuda-80...wnload-archive
And install CUDA 8

Step 3 - Install NVidia CuDnn

The trap is there ....
We start by installing cuDnn 6 for Cuda 8 https://developer.nvidia.com/rdp/cudnn-download
Unzip the file in a directory for example c:\dev\nvidia cudnn
The secret is there: Download all versions of cuDnn and in the bin directory of each CuDNN version extract the DLL only and move it to the original bin nvidia cudnn
Change the path in system and users adding c:\dev\nvidia cudnn

Step 4 - Create an Anaconda environment

In Anaconda console type :
conda create -n tensorflow python=3.5 numpy scipy matplotlib spyder
Activate the environment
activate tensorflow
Install Tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.1-cp35-cp35m-win_amd64.whl
Install Keras
pip install keras
Now test your Tensorflow
Download mnist_mpl.py
And execute the code
Activate tensorflow
python mnist_mpl.py
IT DOES WORK !! Champagne

Bonus - Switch to Tensorflow version 1.4

Copy cudnn64_6 into the CUDA/bin folder
In Anaconda console type Activate tensorflow
Update Tensorflow : pip install --ignore-installed --upgrade tensorflow-gpu
AND IT DOES WORK (again)
Jerome

Suivez moi / Follow me sur/onTwitter https://twitter.com/FortiasJerome 

Commentaires

Posts les plus consultés de ce blog

Quand Google fait un KIT AI hyper débutant !!!

50 niveaux de RaspBerry Pi

Netflix AlphaGo - le documentaire à voir absolument