Explore Courses Blog Tutorials Interview Questions
0 votes
in Machine Learning by (19k points)

I am starting to work with TensorFlow library for deep learning,

I found an explicit guide to work on it on Linux and Mac but I did not find how to work with it under Windows. I try over the net, but the information is lacking.

I use Visual Studio 2015 for my projects, and I am trying to compile the library with Visual studio Compiler VC14.

How to install it and to use it under Windows?

Can I use Bazel for Windows for production use?

1 Answer

0 votes
by (33.1k points)

If you are installing TensorFlow on windows. First thing you should check that whether GPU is required on this installation or not. A recent update of Windows 10 has a Ubuntu Bash environment, AKA Bash on Ubuntu on Windows, available as a standard option. This option came with the Windows 10 anniversary update (Version 1607) released on 8/2/2016. This allows the use of apt-get to install software packages such as Python and TensorFlow.

Please Note: This new feature Bash on Ubuntu on Windows does not have access to the GPU, so all of the GPU options for installing TensorFlow will not work.

Prerequisites for installing TensorFlow.

  • Enable the Windows Subsystem for Linux feature (GUI)

  • Reboot when prompted

  • Run Bash on Windows

Steps no longer needed:

  • Turn on Developer Mode

  • Enable the Windows Subsystem for Linux feature (command-line)

Then install TensorFlow using apt-get

sudo apt-get install python3-pip python3-dev

sudo pip3 install --upgrade

and now test TensorFlow

$ python3


>>> import tensorflow as tf

>>> hello = tf.constant('Hello, TensorFlow!')

>>> sess = tf.Session()

>>> print(

Hello, TensorFlow!

>>> a = tf.constant(10)

>>> b = tf.constant(32)

>>> print( + b))


>>> exit()

This code will run an actual neural network

Another way to install TensorFlow is by installing Anaconda in your system. It includes pre-installed Jupyter notebooks. Then you can install TensorFlow in Jupyter notebook.

To install current latest version please run following command:

pip install tensorflow #CPU only

pip install tensorflow-gpu #For GPU support

Browse Categories