Installing Tensorflow on a Raspberry Pi 400 | by Diego Restrepo-Leal | Aug, 2024


Normally, I make my notebooks in Google Colab or Kaggle, however, today I wanted to make some test notebooks on my Raspberry Pi 400, the tests included the use of tensorflow, so I decided to install it. In the official tensorflow documentation I found the following note:

Note: Starting with TensorFlow 2.10, Linux CPU-builds for Aarch64/ARM64 processors are built, maintained, tested and released by a third party: AWS. Installing the tensorflow package on an ARM machine installs AWS’s tensorflow-cpu-aws package. They are provided as-is. Tensorflow will use reasonable efforts to maintain the availability and integrity of this pip package. There may be delays if the third party fails to release the pip package. See this blog post for more information about this collaboration.

For this reason I am going to install the package:

python3 -m pip install tensorflow-cpu-aws

And it gives me the following error (see figure 1):

Failed to build h5py                                                           
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (h5py)
Figure 1. Tensorflow installation error.

The way I solved it was by first installing the HDF5 library on my operating system:

sudo apt install -y libhdf5-dev

After this I reinstalled tensorflow with the command:

python3 -m pip install tensorflow-cpu-aws

And finally I got a satisfactory result (see figure 2).

Figure 2. Tensorflow installed.
  • Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31–1+rpt1 (2024–05–29) aarch64 GNU/Linux
  • Python 3.11.2



Source link

Be the first to comment

Leave a Reply

Your email address will not be published.


*