How to install TensorFlow in Linux and Raspberry Pi

With TensorFlow, anyone with little experience as a developer can quickly start using machine learning to solve the problem.

Artificial intelligence and machine learning have changed the way we interact with technology. So far, what we see is just the beginning. In the future, both technologies will make things easier, because they do more than humans can imagine.

AI and machine learning can make using technology easy, but not the simplest way to apply them. That's where technology like TensorFlow comes in handy. With TensorFlow, anyone with little experience as a developer can quickly start using machine learning to solve the problem.

What is TensorFlow?

TensorFlow's goal is to help easily build and deploy machine learning models. While those who have experience with machine learning can 'roll up their sleeves' to implement projects immediately, beginners can use the high-level API to get started easier.

How to install TensorFlow in Linux and Raspberry Pi Picture 1

One of the main applications of TensorFlow that we see today is the detection and classification of different objects. Image recognition is not the only thing TensorFlow can do, but companies like Airbnb use it to do this quite often.

As you can imagine, both AI and machine learning have a lot of potential uses in IoT. To make it easier to visualize, see what TipsMake.com 's analysis of machine learning is and what it can do for IoT.

Install TensorFlow on Linux

The easiest way to install TensorFlow on Linux is to use pip, Python package manager. Before you start, you will want to make sure that you meet the basic system requirements. If all of the following works without any problems, you are ready to install TensorFlow on Linux.

How to install TensorFlow in Linux and Raspberry Pi Picture 2

 python3 --version pip3 --version virtualenv --version 

If that fails, you will need to install prerequisites. On Ubuntu, do the following:

 sudo apt update sudo apt install python3-dev python3-pip sudo pip3 install -U virtualenv 

There are two ways to install TensorFlow. The first is to install it all over the system or in the main directory. The second is to install it in a virtual environment. The article will install it in the main directory.

First, the pip guarantee is updated:

 pip3 install --upgrade pip 

Run the following command to install TensorFlow in the main directory:

 pip3 install --user --upgrade tensorflow 

To install GPU support version using Nvidia driver, instead, run the following command:

 pip3 install --user --upgrade tensorflow-gpu 

Now, you need to make sure that TensorFlow is installed correctly. You can do this by running the following command:

 python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))" 

Install TensorFlow on Raspberry Pi

TensorFlow, like most deep-learning libraries, can push powerful hardware to its limits. However, TensorFlow is supported on Raspberry Pi and this is a great way to get started with this tool.

How to install TensorFlow in Linux and Raspberry Pi Picture 3

For these tutorials, let's assume that you have installed Raspberry Pi and run Raspbian.

Installing TensorFlow on Raspberry Pi running Raspbian is easy. First, install the prerequisite libraries with the following command:

 sudo apt install libatlas-base-dev 

Then install TensorFlow with pip with the following command:

 pip3 install tensorflow 

Installing TensorFlow is just the beginning. After you successfully install and run TensorFlow, it's time to start building some test projects to see what it can do.

Hope you are succesful.

4.5 ★ | 4 Vote | 👨 1408 Views
« PREV POST
NEXT POST »