Installing TensorFlow 2.0 on Windows 10 x64

Zebin Wilson
AI Club @gectcr
Published in
4 min readOct 1, 2019

TensorFlow supports x64 only. So if you’re on x86(32 bit) just use Google Colabs

For TensorFlow 2.0 CPU you would just have to run (I do hope you have Python3 installed)

pip install tensorflow==2.0.0-rc1

pip works for Windows if you don’t have Python2. If you’re on Linux or if you got Python2 in Windows change pip to pip3.

If you just want the stable old version do (Do switch pip with pip3 if you got that)

pip install tensorflow

Now for the GPU version, we gotta get our hands dirty. We’ll need a Nvidia GPU for this to work. If you don’t have it, just stick to CPU version(It’ll just take a bit(0<bit<∞) more time)

Stuff you’ll need:

  1. Microsoft Visual Studio(Community would do)
  2. Nvidia CUDA toolkit — 10.0(As of date 30/9/19)
  3. Nvidia cuDNN— 7.6.4 for Cuda 10.0

VISUAL STUDIO

Visual Studio is needed as some functions/components of Cuda toolkit require it.

So let’s do Microsoft Visual Studio first. Head over to this link and download Community version(Well… It’s free)

Community 2019 will do

Install it with required workloads(You won’t need any for the sake of TensorFlow. It’ll work without any workloads too). For installation just keep clicking next or forward XD or just refer this.

After installation you may need to restart your pc.

NVIDIA CUDA Toolkit (10.0)

Now you can install Cuda toolkit. Just head over to this link and download the one for Windows x64.

Select your system settings and download the Base Installer

After downloading install it. It’ll ask for temporary extraction location. Just proceed with the default location. It’ll take some time for extraction.

After that it’ll check for system compatibility. You maybe notified on the install of newer/older driver version based on your current installation.

CUDA INSTALLATION

Go with Express installation

CUDA Visual Studio Integration

Accept and continue with Next. Install it and you’re done with CUDA 10.0 installation.

NVIDIA cuDNN 7.6.4

Head over to this link

Join or Login

Join or Login depending on your account status.

Accept the agreement and download the cuDNN 7.6.4 for CUDA 10.0

cuDNN Download Page

A zip file will be downloaded. Extract the zip file and open the folder.

It’ll look like this

Copy/cut the 3 folders bin, include and lib.

Paste them in your CUDA installation directory. For default installation the location will be

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
CUDA Installation Folder

Paste the files here. After that check the environment variables to verify that the path has been added correctly. Go to

Control Panel ->System and Security->System->Advanced System settings

Select Environment Variables

Environment Variables

Check for Path in User variables as well as System Variables. Click Edit to view the path and check for CUDA location(It’ll be present either in User or System Path. For me it was in System Path variable)

Click the Edit option after selecting Path
Checking the path

AS you can see, there will be 2 paths referring to CUDA\v10.0

They are

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\binC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\libnvvp

Once you’ve verified these 2 are present, head over to Command Prompt.

CUDA version

This would be the output on successful installation.

Finishing Up

Now I do hope you got Python3 x64 bit installed. If not, go here and install it. Don’t forget tick add to path.

Select this option

And after this install TensorFlow 2.0 GPU with in Command prompt as Administrator.

pip install tensorflow-gpu==2.0.0-rc1

If you prefer the stable normal version go with

pip install tensorflow-gpu

Now go to Command prompt and type python. In the command-line interpreter type

import tensorflow as tftf.test.is_gpu_available(cuda_only=False,min_cuda_compute_capability=None)

This should output your GPU compute capability and stuff like that :D

How the output should look if all went well

And with this you would’ve successfully installed Tensorflow-gpu on your Windows x64 system.

The problem with Windows for machine learning is that you’ll need to build stuff from source and this could be a real bitch. Although it’ll be fun(internal screaming) process.

Anyway Happy Coding!!

--

--