Skip to content

SakhriHoussem/How-to-install-tensorflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

How to install Tensorflow GPU

How to install Tensorflow-GPU 1.6 on Windows

Install Python:

Download Version 3.6 64bit here: Windows x86-64 executable installer

Install tensorflow-gpu:

  cd C:\Users\%USERNAME%\AppData\Local\Programs\Python\Python36\Scripts

if you tensorflow already installed so uninstalled :

  pip uninstall tensorflow
  pip install tensorflow-gpu

install Nvidia Driver:

Download Last Version here: Nvidia Last Driver

Install CUDA Tool Kit:

Download Version 9 here: CUDA Toolkit 9.0

Install cuDNN:

  1. Download Version 7.0.5 here: cuDNN v7.0.5 (Dec 5, 2017), for CUDA 9.0

  2. unzip cudnn-9.0-windows10-x64-v7.zip then copy bin &include & lib in :

  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0

Set Your Environment Variables:

  1. Click Windows + R Then type sysdm.cpl and go to advanced and select Environmental Variables

  2. Click on the Path in system variable and select edit

  3. add the following paths

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp

Environment Variables

Test your Installation

use:

GPU Testing

or:
  from tensorflow.python.client import device_lib

  print(device_lib.list_local_devices())

Output:

  [name: "/device:CPU:0"
    device_type: "CPU"
    memory_limit: 268435456
    locality {
    }
    incarnation: 7179507163498351914
    , name: "/device:GPU:0"
    device_type: "GPU"
    memory_limit: 2241268940
    locality {
      bus_id: 1
    }
    incarnation: 14675117801653382741
    physical_device_desc: "device: 0, name: GeForce GTX 1060 3GB, pci bus id: 0000:23:00.0, compute capability: 6.1"
  ]