
Install TensorFlow on Raspberry 64 OS
TensorFlow 32-OS
TensorFlow Lite
Last updated: October 21, 2023
Introduction.
This page will guide you through the installation of TensorFlow on a Raspberry Pi 4 with a 64-bit Bullseye operating system.
TensorFlow is a large software library specially developed for deep learning. It consumes a vast amount of resources. You can execute TensorFlow on a Raspberry Pi 4, but don't expect miracles. It can run your models, if not too complex, but it will not be able to train new models. Nor can it perform the so-called transfer learning. In addition to running your pre-built deep learning models, you may use the library to convert so-called frozen TensorFlow models to TensorFlow Lite flat buffer models.
If you only want to get some impression of deep learning, please consider installing TensorFlow Lite. It is much faster and uses far fewer recourses, as being designed for small computers like a Raspberry Pi. There are many ready build models you can use. See our installation guide for the 64-bit Raspberry here.
Roadmap.
TensorFlow continues to grow. Each new release requires more resources, supporting software and libraries. It increasingly puts a heavy burden on your Raspberry Pi. It explains why the latest versions don't work well on 'old' Raspberry Pis with an 'outdated' operating system.
On the other hand, it is not advisable to install a very old TensorFlow version on the latest Bullseye. You will be forced to downgrade some system libraries, which will prevent other software from working. The motto here: "Go with the Flow".
Below is an overview. A green checkmark indicates a wheel is available. An empty green box means there is no wheel, but installation is still possible. A grey box specifies hardware or software limitations that do not allow a 'normal' installation.
System / TensorFLow vesion | 2.14 | 2.13 | 2.12 | 2.11 | 2.10 | 2.9 | 2.8 | 2.7 | 2.6 | 2.5 | 2.4 | 2.3 | 2.2 | 2.1 | 2.0 |
Raspberry Pi 32-bit Buster | √ | √ | |||||||||||||
Raspberry Pi 64-bit Buster | √ | √ | √ | √ | √ | ||||||||||
Raspberry Pi Ubuntu 18.04 | √ | √ | √ | ||||||||||||
Raspberry Pi Ubuntu 20.04 | √ | √ | √ | √ | √ | ||||||||||
Raspberry Pi Bullseye | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | |||||
Raspberry Pi Bookworm | √ | √ | √ | ||||||||||||
Jetson Nano JetPack 4.6 | √ | √ |
Tip.

We are happy to comply with this request. Please, find a complete working Raspberry Pi 4 dedicated to deep learning on our GitHub page. Download the zip file from our GDrive site, unzip and flash the image on a 32 GB SD-card, and enjoy!
We discuss two installations, one for Python 3 and one C++ API library. Unfortunately, there is no official aarch64 pip3 wheel available for the 2.7, 2.6 or 2.5 versions. However, we created our wheels with Bazel and put them on GitHub for your convenience.
Preparations.
Numpy.
Tensorflow has encountered issues with the latest versions of numpy. It became a real struggle to port TensorFlow to numpy 1.20. Now, with TensorFlow version 2.8.0, it finally succeeded. At last, there are no numpy version conflicts anymore when TensorFlow is installed.
However, TensorFlow 2.7.0 still reports a few issues. To be on the safe side, use numpy version 1.19.5 for TF 2.7.0 to make sure everything is working fine.
libclang 9.0.1.
TensorFlow 2.7.0 relies on libclang 9.0.1. There is no distribution available for Debian 10. That's why there is only a TensorFlow 2.7 installation for Debian 11, Bullseye. You could probably install libclang 9.0.1 on your Buster RPi from scratch so that you can then install TensorFlow. Be aware, the clang build takes huge resources, over 5 GB. It's better to switch to Bullseye and have TensorFlow up and running in half an hour.
Protobuffer 4.21.
The latest version of Protobuffer 4.21.0 has some significant improvements over the previous version 3.20.1. However, TensorFlow does not yet support these changes. For TensorFlow to work, you need to downgrade your Protobuf to version 3.20 if you have 4.21 installed.

tensorflow-io-gcs-filesystem.
All dependencies can be installed with just one command, except for the tensorflow-io-gcs file system. Since there is no distribution for an aarch64 machine, we have to build the tensorflow-io-gcs file system from scratch. The entire procedure can be found below and should be done before TensorFlow itself is installed. If you let TensorFlow install the io-gcs, it will select the wrong version and will not work.
# get a fresh start
$ sudo apt-get update
$ sudo apt-get upgrade
# install pip3
$ sudo apt-get install git python3-pip
# install correct version protobuf
$ sudo -H pip3 install --upgrade protobuf==3.20.0
Method 1
# download tensorflow io
$ git clone -b v0.23.1 --depth=1 --recursive https://github.com/tensorflow/io.git
$ cd io
$ python3 setup.py -q bdist_wheel --project tensorflow_io_gcs_filesystem
$ python3 setup.py -q bdist_wheel --project tensorflow_io_gcs_filesystem
$ cd dist
$ sudo -H pip3 install tensorflow_io_gcs_filesystem-0.23.1-cp39-cp39-linux_aarch64.whl
$ cd ~
Method 2
# or download wheel
$ git clone https://github.com/Qengineering/Tensorflow-io.git
$ cd Tensorflow-io
$ sudo -H pip3 install tensorflow_io_gcs_filesystem-0.23.1-cp39-cp39-linux_aarch64.whl
$ cd ~
TensorFlow wheels for Python 3.9.
TensorFlow is installed by a Google software installer called Bazel. In the end, Bazel generates a wheel to install the TensorFlow Python version or a tarball when it comes to installing the C++ version. Both methods are well known to Raspberry Pi users. We have posted the Bazel outcomes on our GitHub page. Feel free to use these wheels. The whole TensorFlow installation procedure from start to end takes many hours (±64 for Python, ±1 for the C++ library). With all the tedious work already done, it takes only a few minutes to install TensorFlow on your Raspberry 64-bit Bullseye. For the diehards, the complete procedure is covered later in this manual.
The whole shortcut procedure is found below. The wheel was too large to store at GitHub, so Google drive is used instead.