Tensorflow (eng)steemCreated with Sketch.

in #tensorflow7 years ago

I decide to install tensorflow and document all the process, from the installation to running some Machine Learning models. 

Everything explained here is run under Ubuntu and with python 2.7. I download Anaconda Python since it install  all the libraries necessary to run ML models (scipy, sklearn, numpy etc)

First go to  Tensor Flow we are going to install Tensor Flow with CPU support because its easier. If you have a Nvidia GPU then you can install Tensor Flow with GPU  support and accelerate the computations.    

To install TensorFlow we open a terminal (ALT + CTL + T) and execute the command:  

 $conda create -n tensorflow

We are creating an enviroment, an enviroment is a directory with a collection of python packages. The idea of enviroments is to prove our programs with different versions of the package and maintaining previous versions.

We can switch enviroments using the command source activate. For example to use our new enviroment we use

$source activate tensorflow

If you then run the following command, you will se all the enviroments and the * marks the enviroment we are using

$conda-env list

 Once we are in the new enviroment we install tensorflow with the command:

$pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp27-none-linux_x86_64.whl 

After 3 minutes the installation is done. To check if everything is runnung run the following python script

import tensorflow as tf
hello = tf.constant('Hola, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

You should see Hello in the terminal. As simple as that!

Sort:  

Congratulations @anfego! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Notifications have been disabled. Sorry if I bothered you.
To reactivate notifications, drop me a comment with the word NOTIFY