Memory Issues ERR: Failed to allocate snapshot buffer!

Hello. I want to report the memory problem bug. I have tried hundreds of models, all image sizes, RGB or grayscale, from training with only 30 images to doing it with more than 500. The summary of RAM and ROM that the website shows is much less than what the web supports ESP32 CAM. I have searched and many have the same problem as me, so I have concluded that it is a library problem. I use a model that I created in October 2023 and it works correctly. I make the model with the same images and characteristics and it doesn’t work. I think it is a problem with some library update made by the creators between October and December 2023. Has anyone done training around these dates and not have this problem? Is there any way you can help us? Thank you so much

1 Like

Hi!
We will need a little bit more information here.
Can you share:

  1. The old project deployment
  2. The new project deployment
  3. Which environment do you use for programming ESP32 - is it Arduino ESP core (which version?) or ESP IDF (which version?) Do you have PSRAM enabled?
  4. What is the exact name of hardware do you use?
    For the projects files, if you don’t want to share them publicly, you can send them to dmitry@edgeimpulse.com.

Hi,

Yesterday I discovered exactly the same problem. An impulse made 4 novembre 2023 works while new ones end up with β€œFailed to allocate snapshot buffer”.
I made the new project public nr.: 330996 . The sketches are the examples from the downloaded Edge Impulse arduino library. I’ve tried 3 different AIthinkers.
Tried arduino 1.18.19 and arduino 2. Reinstalled Win 10 and 11.
No difference. I’ve included serial output of ESP32 camera and static buffer sketch.

Kind Regards
Joe

ESP32 camera output

22:23:00.944 β†’ rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
22:23:00.944 β†’ configsip: 0, SPIWP:0xee
22:23:00.944 β†’ clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
22:23:00.944 β†’ mode:DIO, clock div:1
22:23:00.944 β†’ load:0x3fff0030,len:1344
22:23:00.944 β†’ load:0x40078000,len:13964
22:23:00.944 β†’ load:0x40080400,len:3600
22:23:00.944 β†’ entry 0x400805f0
22:23:01.345 β†’ Edge Impulse Inferencing Demo
22:23:01.568 β†’ Camera initialized

22:23:01.568 β†’
22:23:01.568 β†’ Starting continious inference in 2 seconds…
22:23:03.805 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:03.852 β†’ No objects found
22:23:04.106 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:04.106 β†’ No objects found
22:23:04.375 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:04.375 β†’ No objects found
22:23:04.623 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:04.623 β†’ No objects found
22:23:04.854 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:04.854 β†’ No objects found
22:23:05.152 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:05.152 β†’ No objects found
22:23:05.378 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:05.378 β†’ No objects found
22:23:05.656 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:05.656 β†’ No objects found
22:23:05.926 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:05.926 β†’ No objects found
22:23:06.180 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:06.180 β†’ No objects found
22:23:06.427 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:06.427 β†’ No objects found
22:23:06.681 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:06.681 β†’ No objects found
22:23:06.960 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:06.960 β†’ No objects found
22:23:07.229 β†’ Predictions (DSP: 2 ms., Classification: 131 ms., Anomaly: 0 ms.):
22:23:07.229 β†’ No objects found
22:23:07.361 β†’ ERR: Failed to allocate scratch buffer of size 24, reached EI_MAX_SCRATCH_BUFFER_COUNT
22:23:07.361 β†’ Failed to initialize the model (error code 1)
22:23:07.361 β†’ ERR: Failed to run classifier (-6)
22:23:07.483 β†’ ERR: Failed to allocate scratch buffer of size 24, reached EI_MAX_SCRATCH_BUFFER_COUNT
22:23:07.483 β†’ Failed to initialize the model (error code 1)
22:23:07.483 β†’ ERR: Failed to run classifier (-6)
22:23:07.583 β†’ ERR: Failed to allocate scratch buffer of size 24, reached EI_MAX_SCRATCH_BUFFER_COUNT
22:23:07.630 β†’ Failed to initialize the model (error code 1)
22:23:07.630 β†’ ERR: Failed to run classifier (-6)
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.630 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.683 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!
22:23:07.730 β†’ ERR: Failed to allocate snapshot buffer!

Static buffer output:

22:54:39.623 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:39.623 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:40.625 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:40.625 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:41.627 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:41.627 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:42.654 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:42.654 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:43.640 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:43.640 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:44.641 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:44.641 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:45.625 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:45.625 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:46.645 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:46.645 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:47.662 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:47.662 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:48.649 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:48.649 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:49.620 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:49.620 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:50.654 β†’ Edge Impulse standalone inferencing (Arduino)
22:54:50.654 β†’ The size of your β€˜features’ array is not correct. Expected 2304 items, but had 0
22:54:51.657 β†’ Edge Impulse standalone inferencing (Arduino)

We have identified the source of the issue and fixed it. The fix will be deployed to production very soon - I will write a separate message when it is deployed.

The fix has now been deployed to production.

1 Like

Cool!

Looking forward to enjoy your great API.

Yes!! Works again.
Thanks for superquick reaction.

Kind regards
Joe

1 Like

@AIWintermuteAI and @biobiejojo Thanks, It works again :slight_smile: greetings!