Installing Fastai on Raspberry pi

Hi,

For the past few days I have been trying to install fastai on my raspberry pi 3b+. I have had no luck. I have an understanding that pytorch is required for fastai to actually run, but I have had no luck in that department as well.

I was wondering if anyone had any success in using their trained model on the rpi or just getting fastai working on the pi in general.

If no one has been able to get it working, are there any other cheap alternatives for running fastai on a board?

Thanks

@runninbear5

This is a good thread to follow base on your interests in running on Pi


and

Hi, forget about raspberry pi 3b+ and DL with usual framework TF or pytorch. I spent months working with TF Lite and eventually I gave up: the engine during inference is unstable. Moreover, on boards like rpi3 forget python if you really want something that works you have to code in C++.

My advice is you better buy a nvidia jetson nano or google coral much better even than raspberry pi 4.

But, if you’re still in love with rpi3 look at Berry Net :wink:

@yubozhao thanks for torch2trt !! It will be very useful :slight_smile:

1 Like

I’ve continued trying to install everything on the raspberry pi and I’ve hit minor success. I was able to utilize a docker image that came with pytorch and it worked successfully.

The problem was when it installed, it used python 3.5 which is not supported by fastai. I proceeded to make the docker image run with python 3.7 and quickly ran into problems. The package i was using for pytorch was only for python 3.5. The package is called torch-raspi (https://pypi.org/project/torch-raspi/#description). I was wondering if anyone had experience in upgrading a pip package or knew how to make one. Clearly something can be done to get pytorch on a raspberry pi, but I don’t know how to make my own.

Thanks

If you just want to do some inferencing on a pi, its a good idea to use hardware acceleration. 2 main options, Google Coral or Intel Movidius, options below:

  1. https://github.com/robmarkcole/coral-pi-rest-server (tflite)
  2. https://medium.com/deepquestai/deepstack-for-raspberry-pi-intel-neural-compute-acceleration-1cf7d0b5e859 (deepstack uses pytorch backend)

Hi! One can usually build a pip package from source, it just takes forever to actually do that directly on a raspberry pi. I managed to get the vision part of fastai running on a raspberry pi zero using Python 3.6.

It’s quite slow, but if you want to try yourself I’ve published my packages here: https://github.com/peksa/fastai-raspberry-pi

1 Like