Installing Tf - Riteshgiri/TensorFlow GitHub Wiki
Outlining the steps for successful working of TensorFlow on Windows Operating System.
TensorFlow installation has two types :
- With CPU support
- With GPU support
Its recommended to intall TensorFlow with CPU support unless one needs to run performance critical applications. So for learning TensorFlow, move ahead with installation of "TensorFlow with CPU support" steps of which are listed below.
-
Get Python 3.5.x from python.org TensorFlow only supports Python 3.5.x on Windows because Python 3.5.x comes with a pip3 manager. (while installation, if you run a Custom Installation, you will see the pip manager listed first. Check that box and you can continue with the installation. This is just to show new users PiP manager in installation stage. Even if a user runs the Default Installation, pip will still be installed). In case you have any other version of Python installed, uninstall python and install Python 3.5.x
-
Open terminal and enter the following command to install TensorFlow Libraries.
C:\> pip3 install --upgrade tensorflow
This might take some time. In case an error outputs at the end of operation, simply run the terminal (Command Prompt) as Administrator. It will help you not to get stuck.(In case the version of pip installed is not the latest version, the user might get a recommendation to install the latest version. Just ignore and move ahead ).
That's It! And you are all set to use TensorFlow Libraries.
Close the Terminal and Open the Python Interactive Shell or the IDLE. Type in the following code to run our first program of TensorFlow and test it's successful installation.
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
OUTPUT
Hello, TensorFlow!