HOW TO INSTALL TENSORFLOW [ (import tensorflow as tf)]
3 min readJan 2, 2018
Recently I wanted to learn Tensorflow so I took some time and started focusing on the Tensorflow . In this post I’ll walk you through the installation process of Tensorflow (CPU version).
Here are the simple steps on
How to get started with Tensorflow on Windows?
- Download Anaconda here and get it installed in your system as per your specifications.
- After having Anaconda installed , create a virtual environment. To create that open command prompt and type the command
> conda create -n tensorflow python=3.6 - This helps in creating a conda environment named as tensorflow having python version 3.6
- Before we can work with our conda environment that has just been created , we have to activate it using the command below:-
>activate tensorflow
We will see the following screenshot in our command prompt
- Now to install cpu version of tensorflow inside our created environment use the following command:-
>pip install — ignore-installed — upgrade tensorflow
The screen will be populated with all the necessary dependencies that are needed to be downloaded for tensorflow :-
- Below are the points to check whether we have successfully installed tensorflow :-
- In the command prompt start a python session using the command >python
- Import the tensorflow package using :-
> import tensorflow as tf - Check for tensorflow version that has been installed
> tf.__version__
Above three steps has been summarized in the snapshot below:-
- At any point of time if you want to get out of python session use the command
>quit()
And we are out of python session.
- To install any package within the environment use the command (tensorflow)> conda install any_package_name
where any_package_name is the name of the package you want to install. - To work in Jupyter’s interactive environment using tensorflow , use the command
(tensorflow)> conda install jupyter - Once Jupyter is installed we can work with it by activating the Jupyter notebook using the command
(tensorflow)> jupyter notebook
In my next post , I’ll give a light introduction on how to use Tensorflow.
Untill then Keep Learning, Keep Rocking .