Codementor Events

How To Install Tensorflow On Windows

Published Sep 22, 2017

Recently, I have started learning machine learning, specifically Deep Learning, for one of my pet projects. During this quest of mine, I wanted to learn the TensorFlow library, which is developed by Google.

Learning is one thing, but first, I needed to install the library. However, there was a problem that I faced during the installation.

I use Anaconda as my package manager. Trying to install the TensorFlow library on my work computer, which is behind a proxy, and installing directly from the Anaconda cloud, while behind a proxy, always displayed a proxy error.

How did I resolve the issue? Well, this is exactly what I am going to talk about in the tutorial below.

Before we get all cozy with this short tutorial on installing TensorFlow, let me tell you that this tutorial is based on the assumption that you have already installed Anaconda on your machine and you know at least one or two basic things about Python.

First, you need to download the TensorFlow tar file from the Anaconda cloud from here. You will need to download the file named as "win-64/tensorflow-1.3.0-py36_0.tar.bz2." Additionally, you will also have to download "repodata.json.bz2" from here.

If you want to know what is contained in the repodata.json.bz2 file and why it is important, head over to the Anaconda website, where you can get a detailed description of this file.

Then, open the Anaconda prompt and navigate to the folder where the above files are downloaded: e.g. C:\Users\thecodingproject\Downloads. Run the below commands.

conda install tensorflow-1.3.0-py36_0.tar.bz2
conda install protobuf-3.2.0-py36_0.tar.bz2

Now that you are goody goody with your shiny new TensorFlow installation, it's time to test it. To test the installation, use the below short program in the same Anaconda terminal.

import tensorflow as tf  # import the tensorflow module
hello = tf.constant('Hello, TensorFlow!')  # create a constant tensor
sess = tf.Session()  # create a session for the above tensor
print(sess.run(hello))  # print the session with the run command with contant "hello" as a parameter

If you get an output resembling the one below, you are all sorted.

Hello, TensorFlow!
Discover and read more posts from satyabrata pal
get started
post commentsBe the first to share your opinion
Show more replies