Lesson 11 of 15By Avijeet Biswal
Last updated on Jan 28, 202123246TensorFlow is a wildly popular open-source framework used for numerical computation that makes building machine learning algorithms easy and convenient. In fact, many major companies use TensorFlow, including NVIDIA, Google, Uber, Netflix, AMD, and Target. In this article, we will learn how to install TensorFlow on Ubuntu.
We will cover the following:
TensorFlow is an open-source library that the Google Brain team developed in 2012. It is written in Python, Cuda, and C++.
The initial version of TensorFlow was released under the Apache License in November 2015. The latest major release—TensorFlow 2.0—came out in September 2019. Incremental releases have been released since, and more are still in the works.
The TensorFlow library leverages machine learning and deep learning. TensorFlow was initially developed to run large sets of numerical computations by analyzing data in the form of arrays of large amounts of data illustrated by flowcharts, and more.
In practice, this data analysis will reveal the outstanding dimensions of any initial premise. Let’s dig in.
A tensor is a mathematical object represented as an array of a higher dimension. These arrays of data—with different dimensions and ranks—are fed as input to the neural network to process and build a neural network model.
You need to download Python, the PIP package, and a virtual environment. If these packages are already installed, you can skip this step.
You can download and install what is needed by visiting the following links:
https://pip.pypa.io/en/stable/installing/
https://docs.python.org/3/library/venv.html
To install these packages, run the following commands in the terminal:
sudo apt update
sudo apt install python3-dev python3-pip python3-venv
Navigate to the directory where you want to store your Python 3.0 virtual environment. It can be in your home directory, or any other directory where your user can read and write permissions.
mkdir tensorflow_files
cd tensorflow_files
Now, you are inside the directory. Run the following command to create a virtual environment:
python3 -m venv virtualenv
The command above creates a directory named virtualenv. It contains a copy of the Python binary, the PIP package manager, the standard Python library, and other supporting files.
source virtualenv/bin/activate
Once the environment is activated, the virtual environment’s bin directory will be added to the beginning of the $PATH variable. Your shell’s prompt will alter, and it will show the name of the virtual environment you are currently using, i.e. virtualenv.
pip install --upgrade pip
The virtual environment is activated, and it’s up and running. Now, it’s time to install the TensorFlow package.
pip install -- upgrade TensorFlow
To check if TensorFlow has been installed successfully, run the following lines of code on Jupyter Notebook. Print the version of TensorFlow, and perform a mathematical operation.
The lines of code above can be run in command prompt or on any Python IDE. If someone is using Jupyter Notebook for all of their code, for instance, they can run the same commands here as well.
Want to gain expertise in Deep Learning? Then take up the Deep Learning Course (with Keras & TensorFlow) and start your career in Deep Learning.
TensorFlow helps users implement complex machine learning and deep learning models to solve business problems. In this article, we covered the TensorFlow installation on Ubuntu. Do you have any questions for us? Please leave it in the comment section below.
As more and more companies adopt TensorFlow, they are in need of highly qualified professionals who have the right skills. If you’re interested in adding Flowcharts to your tool belt, check out Simplilearn’s AI and Machine Learning certification course today!
Avijeet is a Senior Research Analyst at Simplilearn. Passionate about Data Analytics, Machine Learning, and Deep Learning, Avijeet is also interested in politics, cricket, and football.
Deep Learning Tutorial
Deep Learning Interview Guide
Keras vs Tensorflow vs Pytorch: Understanding the Most Popular Deep Learning Frameworks
What Is TensorFlow 2.0? The Best Guide to Understand TensorFlow
What is Tensorflow: Deep Learning Libraries and Program Elements Explained
Introduction to Machine Learning: A Beginner's Guide