Install fastai on raspberry pi 3 b+

thanks @same for the update.

Yep, I managed to get PyToch 1.3.1 and PyTorch Vision both working on my Pi 4. And I have my AI model built and working. I’m trying to load fastai onto my Pi 4.

However, when trying to install Fast.Ai, as Fast.Ai contains NLP part as well, so it requires SpaCy which breaks everything… it requires Python 3.6 version, which unfortunately I have Python 3.7

I then installed Python 3.6.9 in virtual venv , then tried to building PyTorch 1.3.1, but torch somehow keeps copying files from my Python 3.7, thus once the building and installation finished, I tried to
import torch

it throws me error saying cannot find touch._C, or something like this… stuck here the whole night and I’m not sleepless…tried…

I therefore, suggest Fast.Ai @jeremy to have VISION, NLP etc. components to be as separated components which are required when needed. Like PyTorch has Vision separated as well.

hi friends,

I finally got PyToch, PyToch Vision and Fast.Ai all installed successfully on my Raspberry Pi 4 :slight_smile:

thanks for your help.

Congrats.

Can you post the steps that led you to success?

I tried everything for Rpi3 and still no luck. Pre compiled wheels and even tried to compile pytorch myself.
I am using Raspbian Buster. But nothing worked until now.

Just in case its helpful, I’ve compiled a version of torch 1.4 and torchvision 0.5 for the Raspberry Pi (Tested with an RPi 3B and Raspbian Buster). These wheels have the NEON optimisations enabled, and can support the new torch jit functionality also. You should then be able to load exported fastai models into pytorch and run inference from there!

You can find the wheels here:

and the docker images I used to compile these wheels here:

3 Likes