We really love Edge Impulse and managed to collect the data and train the model fine so far.
Now, we would like to deploy our model to the Raspberry Pi Zero and have seen that it is not officially supported. We could not get the command line tools to work, so what I tried next was to get the C++ SDK working.
I am unable to compile the C-library I exported directly on the Raspberry Pi. The execution just stops at some random point (maybe out of memory??)
It would probably make more sense to compile the model on my Mac with the Raspberry Pi Zero as the target for the model file. How would I do that?
Or is there a better approach that you would suggest we try?
These instructions are updated after getting it working
What worked for me was to follow the custom C++ porting guide here:
Download your model from the Web interface as a C++ library.
Copy and extract the folder on the Pi.
Add your data as in the tutorial
Add the Makefile from the Tutorial.
Now there are two options:
1 (confirmed working) Compile the model on the Pi Zero directly.
2 cross-compile for your target architecture
Good luck to whoever is trying something similar.
Now all that’s left to do is write the sensor input data pipeline in C++.
I have read your post and it was a great help with the CLI installation on my Pi. I can however still not get the edge-impulse-linux-runner CLI tool to work:
pi@raspberrypi:~/buzzinga/edge/model_deploy/buzzinga-project-1-v5$ edge-impulse-linux-runner
Edge Impulse Linux runner v1.3.1
Project: buzzinga-project-1 (ID: 82131)
[RUN] Failed to run impulse Error: Unsupported architecture "armv6l", only armv7l or aarch64 supported for now
at RunnerDownloader.getDownloadType (/usr/lib/node_modules/edge-impulse-linux/build/cli/linux/runner-downloader.js:35:27)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async RunnerDownloader.getLastDeploymentVersion (/usr/lib/node_modules/edge-impulse-linux/build/cli/linux/runner-downloader.js:62:28)
at async /usr/lib/node_modules/edge-impulse-linux/build/cli/linux/runner.js:126:31
Yeah, reading the doco (for once), its not going to work unless you compile your own binary file as @buzzinga has described.
…
Edge Impulse for Linux models are delivered in .eim format. This is an executable that contains your signal processing and ML code, compiled with optimizations for your processor or GPU
…
Hi @jenny . Thanks for getting on this so quickly:
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 997.08
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7
Hardware : BCM2835
Revision : 9000c1
Serial : 000000008f5aad25
Model : Raspberry Pi Zero W Rev 1.1
Turns out it was a matter of memory usage and me having accidently pre-compiled parts of the library on my local machine, which of course causes incompatible binaries.
Thanks @buzzinga, fixed this by updating the npm version to @6.14.15, and then run
npm config set user root && sudo npm install edge-impulse-linux -g --unsafe-perm command.
This is usually because there is not enough memory available on the RPI, you can specific the numbers of cores to be used when compiling. For example, make -j1 for one core, and -j2 for 2 cores.