Categories
Windows 10

The best way to install TensorFlow with GPU support on Windows 10 (without installing CUDA)

The best way to install TensorFlow with GPU support on Windows 10 (without installing CUDA)

Python environment setting with Anaconda Python
Install Anaconda Python
1) Download and check the installer
Run the installer
VSCode?
Check your installation
Update your Anaconda packages
Anaconda Navigator
Create a Python Virtual Environment for TensorFlow by using the conda
* “Activating” the environment
Install the TensorFlow-GPU from the Anaconda Cloud repositories
Make sure that TensorFlow works with your GPU
Create the Jupyter Notebook Kernel for the TensorFlow environment
An example is using Keras with the Backend TensorFlow
Install Keras
Launch of the Jupyter Notebook
Example MNIST
Import Dependencies
Download and process MNIST data
Create the neural network structure LeNet-5
Translate the form
Set the log data to be fed to TensorBoard for visual analysis
Training Form
Result

See a job with TensorBoard

I wrote two weeks ago a publication titled Installing TensorFlow with GPU support on Windows 10 (without installing full CUDA). What you are reading now is an alternative to this post.
In this old post I could not find a way to install some of the CUDA at least. You try to reduce it by installing the base DLL only to make things work. It requires making changes to “User PATH” which you have to do. I’ve now found a way around this using the Anaconda Python bouquets only.
I was installing pytorch on Linux and Windows 10, and noted that they add the CUDA and cuDNN libraries needed with a separate Anaconda package (pytorch / cuda90 or 91). I tried this package with TensorFlow but it did not work. However, I searched Anaconda Claud and found anaconda packages supported for CUDA 9.0 and cuDNN 7 that worked! All I had to do was install these two packages in the default Kunda environment for TensorFlow. [The Linux TensorFlow package includes Anaconda CUDA and cuDNN internally in the same package. ]
The focus here is to get a good GPU working environment to speed up TensorFlow (with Keras and Jupyter notebook) and run them for Windows 10. You will not need to install CUDA for this purpose!
In this publication, I will draw you through the best way I have found so far to get a good TensorFlow working environment on Windows 10 including GPU acceleration. I will also go through the preparation of Anaconda Python and create an environment for TensorFlow and how to make it available for use with the Jupyter notebook. As an “unusual” example of using this setting, we will continue to train LeNet-5 with Keras using TensorFlow with GPU acceleration. We’ll get 18 times faster setup than using the CPU alone.

Python environment setting with Anaconda Python

I highly recommend using Anaconda Python. If you need some arguments to use Python, take a look at my published post. Do you learn programming with Python. For arguments on why you should use the Anaconda Python distribution see, how to install Anaconda Python and First Steps for Linux and Windows. The best reason to use Anaconda Python in the context of installing the accelerated TensorFlow GPU is that you do not have to do CUDA installation on the system.
Anaconda focuses on data science and automated learning. It is installed correctly on your system in one directory so that no clutter occurs in your application directories and library systems. It also improves performance and connects important digital nodes such as the solution to MKL from Intel.
Install Anaconda Python
1) Download and check the installer
Go to the Anaconda Downloads page https://www.anaconda.com/downloads and get Python 3.6.
It is good practice to check the fragmentation of the file to make sure you got a good copy. [I must admit that I do not always do this myself. ]
Open Powershell and cd to the directory in which you downloaded the Anaconda installation program file. In my case is the downloads directory.
CD downloads
Then run

Get-FileHash. Anaconda3-5.2.0-Windows-x86_64.exe -Algorithm SHA256

Look for the fragmentation of the file you downloaded. Check that they match.
Run the installer
Because Powershell is open in the directory using an Anaconda exe installation file, you can start it by typing its name (type A and hit to expand the name) and hit Back. [You can instead just double click on the download install xp. From your browser files. ]
. Anaconda3-5.1.0 Operating Windows-x86_64.exe
The GUI installer should now run.
You will be asked to accept a license agreement …
“Select installation type” We recommend that you select “Just Me” as this is part of your personal development environment.
“Choose the installation location” I recommend that you keep the default that is at the top level of your user directory.
“Advanced Installation Options”
Advanced installation
My recommendation is to check both boxes. Make Anaconda Python 3 your default Python. As a developer, you should be familiar with your PATH environment variable.

Leave a Reply

Your email address will not be published. Required fields are marked *