Error "Failed to allocate snapshot buffer" when running Edge Impulse firmware on Spresense

Issue:
I’m encountering an issue when installing and running firmware from Edge Impulse on Spresense. When I try to run the firmware, I receive the error message “Failed to allocate snapshot buffer!” and “Trying to allocate 57600!”. I have tried several solutions but have been unable to resolve this error.

Detailed information about my environment:

Image resolution: 96x96 pixels
Number of classes: 2

I have attempted the following solutions without success:

Checking settings and configurations: I have reviewed the settings and configurations related to edge-impulse and Spresense SDK to ensure they are properly configured.

I am seeking support from the community to address this issue. If anyone has encountered a similar error or has any suggestions, solutions, or insights, please kindly share them with me. I greatly appreciate any assistance in resolving this issue so I can proceed with my project.

Project ID: 229697

Thank you sincerely,

Entier

Hi @nntruyen ,

From the error it seems there is not enough free RAM to allocate the buffer used to store the snapshot - could be the model is too big and there isn’t enough for the buffer.
What’s the project ID ?
Did you build the project starting from our public repository for the Sony Spresense or from the deployment page of your project ?

regards,
fv

1 Like

Thanks for watching!

My project ID is: 229697

How to build the project starting from your public respository for Sony Spresense. Your mind is On your Spresense by Sony development board - Edge Impulse Documentation ?

I’ve checked your project.
You are using the wrong learning block, try to use the Transfer learning (Images).

instead of the Akida one that is actually used.
let me know.

regards,
fv

Thanks, I tried it but it still happen. So that is not solution for my problem

Make your EI project public and I will clone it and try running on my Spresense.

I have make it public. You can clone it

I have tried to build your project as C++ library and then include into the Spresense fw or build directly for Sony Spresense but the result is the same as yours, the model is too big and can’t allocate RAM for the buffer.

I tried some optimization, reducing the number of video buffer from 3 to 1 but then the problem is that it can’t allocate the TFLite arena.

Take into account that of the 1.5 MB of RAM on the board, on our firmware only half are available for the main core.
A solution could be to use an Arduino Sketch in which you can decide the RAM for the Main core without rebuilding the Spresense SDK.
@MMarcial shared some example some time ago, not sure if for Image classification too.

What should I do with my project. Do I use CircuitPython with EI project on my spresense?

I would follow this tutorial first so that you can understand what the Edge Impulse Studio can do.

Then investigate using the C++ library. See this doc.