Install Tensorflow 2 on a Raspberry Pi 4 // Easy

preview_player
Показать описание

Here's an easy tutorial how to install Tensorflow 2 on a Raspberry Pi

INSTRUCTIONS
Open a terminal window

Make your project directory:
cd Desktop
mkdir tf_pi
cd tf_pi

Make a virtual environment (I'm assuming you have Python 3):
python3 -m pip install virtualenv
virtualenv env
source env/bin/activate

sudo apt-get install -y libhdf5-dev libc-ares-dev libeigen3-dev
python3 -m pip install keras_applications==1.0.8 --no-deps
python3 -m pip install keras_preprocessing==1.1.0 --no-deps
python3 -m pip install h5py==2.9.0
sudo apt-get install -y openmpi-bin libopenmpi-dev
sudo apt-get install -y libatlas-base-dev
python3 -m pip install -U six wheel mock

python3 -m pip uninstall tensorflow

RESTART YOUR TERMINAL

Reactivate your virtual environment:
cd Desktop
cd tf_pi
source env/bin/activate

Test:
Open a python interpreter by executing: python3
import tensorflow
tensorflow.__version__

This should have no errors and output: 2.0.0

Like if you found this helpful.
Let me know in the comments if you ran into any errors.
HAPPY CODING :)

Рекомендации по теме
Комментарии
Автор

It is sad that Tensorflow do not have clear instruction on installing Tensorflow . Thanks for your help.

vjreviewsandiy
Автор

That final moment when he tries to "import tensorflow" was amazing. I know exactly how he feels. Great vide. thanks I was searching forever how to get this done, and ALL the resources where filled with random unique situations that had nothing to do with my issues!

Ash_Industries
Автор

Dude, you rock. Just installed Tensorflow version 2.3.0, and now I have a new virtual environment "env" on my Desktop (in sub /tf_pi). Really, thank you so much for the video, you earned a new sub. Happy coding! :o

speedracer
Автор

Hi Sam, i am experiencing an error with numpy for wheels. can you confirm which numpy version you are using? I am assuming also that python version is 3.7. Also you seemed to omit installing numpy in the virtual environment, are you using numpy 1.21.6? kindly confirm. thanks so much

josephattard_PIC_Spartan_Zynq
Автор

Thank you so very much my guy, I am new to Pi's and have been stuck for hours trying to get this simple stage completed

ABirdi
Автор

literally I had the same look on ur face, when I finally got it to install. thx u sm

garceling
Автор

Seriously awesome. I struggled for ever to get keras to work on ipython in my Raspberry. I followed your instructions and used Tensorflow 2.3 and it works great. Thanks so much for this. I would suggest adding a ETH or BTC address for those who want to tip in your profile.

tomlocke
Автор


I just installed the 2.3 version following your instruction :)

jhuliuscastillosuarez
Автор

Thanks a lot for helping me to install tensorflow in raspberry pi for more than 2 weeks. Now after seeing your video i done it within 30 mins ... Thanks for uploading this valuable video..🙏🙏🙏

varshathguptas
Автор

Thank you!! Now I have installed tensorflow 2.4.0 on my raspberry 2. Perfect tutorial, congratulations

hugosalbidea
Автор

Sam, thank you! I have been trying to get tensorflow installed/working on my pi zero W for days. Your method seems to work. Now I'm off to get my model built and tested. Thanks again for sharing this!

rambo
Автор

Thanks so much Sam. I have been trying to install Tensorflow on my rip 4 for so long. It worked.

Please does anyone know how I can install keras

GrowingTogether_Word
Автор

Got 2.4.0 to work on my RPi 4 from this tutorial. Thanks!

DWithLairdWT
Автор

Great tutorial! This is very helpful :)

Montabouargoub
Автор

I like your content and your channel, but the question. Why would you choose to install TensorFlow on a raspberry Pi? And not a device that has an NPU? Forgive me if I misunderstand what TensorFlow is for but isn't that for machine learning?

BrianThomas
Автор

There is now version v2.1.0, which was released a few days ago (March 17, 2020).

Just change the 2 reference numbers of 2.0.0 to 2.1.0 for the wget.

sgodsellify
Автор

thanks man! you are the best! you saved my life thank you

furkanbaydar
Автор

Thank you! but when installing the packages, why did you use sudo on
"sudo apt-get install -y openmpi-bin libopenmpi-dev
" and
"sudo apt-get install -y libatlas-base-dev",
my understanding was that when using sudo it installs outside of the environment so are these packages meant to be out of the enviroment? or does it just work differently with apt-get?

delicate
Автор

Hello There,

First of all, thanks for your video!
Secondly, could you pls tell me how to load the virtual environment in Mu or any other code editor?
Thanks
Sandor

MrSpark
Автор

I am getting an error at the time of installing tensorflow after the wget command, what I get is: is not supported wheel on this platform. Is it because my python in the virtual env is 3.6.6?

jorgesandoval