Setting up the software environment of deep learning (Tensorflow) on Windows

Tensorflow is a popular framework for deep learning. Ideally, the deep learning software tools and programs should be delpoyed on a Linux server which is more stable and more efficient to make use of the GPU computation power.  Running the deep learning software on Windows is an option when the Linux server is not available, or the purpose is just for learning and testing, not for operational work.

This post will describe the procedures on how to set up the software environment of deep learning (Tensorflow) on Windows.

Step 1: Install Python

A version of Python 3.6 or above is recommended. I personally chose to use Python 3.6.6. The installation package can be downloaded from the weblink:

https://www.python.org/downloads/

Make sure to choose the 64 bit version, since Tensorflow can hardly be used under a 32 bit machine.

Step 2: Install GPU driver, cuda and cudnn library

If you have a NVIDIA GPU card, you can follow this step, otherwise, you can skip this step.

You can go to the NVIDIA website to download the latest version of the GPU driver which matches the model of your GPU card. Then download the cuda and cudnn libraries which are required by Tensorflow. You may need to register an account on the NVIDIA website when trying to download the libraries. The version of cuda and cudnn libraries I chose to use is version 10.0. We do not need to use the most recent version of the cuda and cudnn libraries since the Tensorflow is picky about the cuda and cudnn versions.

Step 3: Install an IDE for python programming

Python’s built-in IDE seems not efficient and slow when running a computation intensive program. That is mainly the reason why we need to use a different IDE for python.

LiClipse is a good choice for the IDE. It is very similar to Eclipse and supports python, java and other programming languages. It can be downloaded from:

https://www.liclipse.com/download.html

Make sure that you set up the correct python path in the python project properties.

LiClipse is a commercial software. If you prefer to use Eclipse which is a free software, you can go to

https://www.eclipse.org/downloads/ to download the latest version of Eclipse and after the installation of Eclipse, install the new software of pyDev from the help menu of Eclipse. You need to input the link of pyDev to install the Python IDE for Eclipse:

http://pydev.org/updates

The IDE software also requires a certain  version of java. The version I use is jre-8u211-windows-x64. You can go to the website of Oracle to get that version of java to install.

If you see an error when running a python program from LiClipse, it means you may need to install the  Microsoft Visual C++ Redistributable for Visual Studio at:

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Step 4: Install Tensorflow

upgrade  the pip3 first:

python -m pip install --upgrade pip

Find out what versions of Tensorflow are available to install:

pip3 install tensorflow==

or

pip3 install tensorflow-gpu== if you have a GPU card.

Find out what versions of OpenCVare available to install:

pip3 install opencv-python==

Install the Tensorflow and OpenCV:

pip3 install opencv-python==3.4.2.16
pip3 install tensorflow==1.14.0

or
pip3 install  tensorflow-gpu==1.14.0 (if you have a GPU)

Use the command below to test if the installation is succssful:

C:\Users\suh> python -c "import cv2; print(cv2.__version__)"
3.4.2

C:\Users\suh> python -c "import tensorflow as tf; print (tf.__version__)"
1.14.0

Tensoflow 1.14.0 is the most recent stable version. Tensoflow-gpu 1.14.0 requires cuda and cudnn version 10.0.

Step 5: Go through the tutorial course on Tensorflow

Follow the official website:

https://www.tensorflow.org/tutorials

This entry was posted in Research. Bookmark the permalink.