How to get Edge Impulse model to run on raspberry pi zero

As a newbie, I found it is very confusing looking at different forum threads on this topic, some from last year, and I have no idea if that’s still relevant or not, and I have no idea which path is the correct path to get edge impulse model to run on raspberry pi zero.

I have the following one unzipped on raspberry pi zero:

ls -ltr

total 28
drwxr-xr-x 2 root root 4096 Oct 10 02:48 tflite-model
-rw-r–r-- 1 root root 1815 Oct 10 02:48 README.txt
drwxr-xr-x 2 root root 4096 Oct 10 02:48 model-parameters
drwxr-xr-x 9 root root 4096 Oct 10 02:48 edge-impulse-sdk
-rw-r–r-- 1 root root 458 Oct 10 02:48 CMakeLists.txt
-rw-r–r-- 1 root root 4938 Oct 10 04:21 Makefile

What would be the next step to try to get edge-impulse model compiled on raspberry pi zero? Also I saw it was mentioned in some thread that raspberry pi would have to be 64bit instead of 32bit (armv7l)??

Follow this tutorial to get started.

1 Like

Hi I just tried, with “make -j 1” via ‘sh build.sh’, the raspberry pi 32bit OS hang up when running this:
‘g++ -I. -Wall -g -Wno-strict-aliasing -Os -DNDEBUG -DEI_CLASSIFIER_ENABLE_DETECTION_POSTPROCESS_OP -DTF_LITE_DISABLE_X86_NEON=1 -std=c++14 -c source/main.cpp -o source/main.o’.

Do you think it might work if using raspberry pi 4.0 to do the compilation, and then copy that over to raspberry pi zero, could this path work later?

After disabling raspberry pi GUI (only boot to console), in raspberry pi zero it no longer hang up the OS when it tried to compile, but it kept hitting OOM killer:

[Fri Oct 13 00:57:52 2023] Out of memory: Killed process 1043 (cc1plus) total-vm:529460kB, anon-rss:373396kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:482kB oom_score_adj:0

After bumping up swapfile size in raspberry pi Debian OS, it failed with error shown below (with ‘sh build.sh’ command):

/usr/bin/ld: tflite-model/tflite_learn_5_compiled.o: in function tflite_learn_5_init(void* (*)(unsigned int, unsigned int))': /home/jwu/projects/example-standalone-inferencing/tflite-model/tflite_learn_5_compiled.cpp:28307: undefined reference to tflite::ops::micro::Register_TFLite_Detection_PostProcess()’
collect2: error: ld returned 1 exit status
make: *** [Makefile:112: app] Error 1