hi there, this is Shubham Mittal
from deciphertechnic.com
today I am going to show you
how to install tensorflow on raspberry pi 3
we will be installing
tensorflow release 1.8 on raspbian stretch desktop
first of all
you need to login into your pi
and then fire up the terminal
as we will be installing tensorflow with python 3.5
 
we need to install some dependencies
for tensorflow to work
first of all , we will install pip
sudo
super user do
apt-get
install
python
3 pip
this will install the latest pip for python 3
it is already the newest version
then we will install python3 development tool
sudo apt dash
get install
python3 dev
it is also the latest version right now
ahh, we are planning to install
tensorflow in a virtual environment
that will be isolated from other python installations
it is a good way to install new packages because
it won't interfere with the existing packages
we will be installing virtual env
we will type in
sudo apt-get install
python
dash virtual env
click on yes
so we have installed virtual env now
now we will be creating a new virtual environment using virtual env
we will be creating a new virtual environment with
python 3
so type in virtual
env
dash dash
system
site packages
dash p
python 3
that is package with python 3
oops
we have not written the name of virtual environment
we have to write the name of virtual environment
I will
name it as tensorflow
this will create the virtual environment
it is installing
setup tools
package resources, pip and wheel
so it has finished installing
now we can activate the newly created virtual environment
by using
source
tild sign
tensorflow
slash
bin
slash
activate
now, as we can see
we are in the tensorflow environment
now we have to ensure that
before installing tensorflow
that we are having the latest version of pip
you can easily do that by using
easy_install
upgrade
pip
so we are having the latest version of pip now
now the most important step comes
actually in the official website of tensorlfow
we are having instructions for installing inside ubuntu
and these are often compatible with x86 systems
but it won't be compatible with our raspberry pi
so, we have to find the appropriate binaries for our raspberry pi
so fortunately,
there is a repository in github
which gives us the pre compiled binaries for
latest versions of tensorflow
thanks to their contributors
we can search it
by
download
tensorflow for raspberry pi
github
let me see
yes
this is the github repository
so,
this is giving us the latest release because
it is the latest release
officially 1.8.0
is the latest release of tensorflow
and they are giving us the binaries of raspberry pi one
raspberry pi 2
and odroid c2 as well
so as we are
going to install
for raspberry pi 3
we are using arm version 7 l
wheel file
and I will be installing it for Python 3.5
so I will be using this wheel file
so just
copy this url
copy link address
and in the
terminal, inside
the virtual environment
we have to issue a command
we have to install using pip3 . pip3 install
then paste in the url of the wheel file
by right clicking here
ok
and then press enter
it will download the file
and install it as well
see its downloading
it will download all the necessary packages for tensorflow itself
and
install it. It will take time
some thing between
5 to 10 min
ok
now we have
now we have
tensorflow successfully installed
inside the tensorflow
environmentm
now we are going to validate the
tensorflow installation. Still inside
the virtual environment
quickly fire up the python interpreter
using
python
we will type in python
import
tensorflow
as tf
we are going to
run a small
tensorflow code
to test our tensorflow installation
first of all, we are going to test the tensorflow version
which is
we expect it to be
1.8.0
tf dot
underscore underscore
version
underscore underscore
it's 1.8.0 . that's OK
now, we will
create a constant
hello is equal to tf.constant
hello tensorflow
now
with
tf.
session
as sess
print
sess
dot run
hello
ok
it is telling us
hello tensorflow
that is the expected output of the program
using tensorflow
this leads to the conclusion that
we have installed tensorflow
successfully on
our raspberry pi
Thanks for watching this video
If you like my video
Please Subscribe for more such
videos.
thank you
