ESP32 classifier memory overflow issue with 32 or more output classes

Question/Issue:
Hello, I have made a classifier for classifying 9axis IMU data. I am running it as a generic C++ library on an ESP32-C2-DEVKIT (I have also confirmed the same problem on ESP32-S3), via arduino framework for platform.io on VScode.

I have 34 output classes I would like to classify however, the ESP32 encounters a memory issue when calling the run_classifier() function. I dug into the library a little, and it seems to be an issue with a matrix being indexed out of bounds, the device actually returns the classification scores correctly and then crashes.

If I manually disable some data in the edge impulse editor to only have 30 classes, the library works fine, which is very strange.

For reference, the error message I receive over serial com is:
Guru Meditation Error: Core 0 panic’ed (Load access fault). Exception was unhandled.

I have 34 output classes I would like to classify
Project ID:
338898
Context/Use case:
classifying 9axis IMU data

Hello @Matthew-Welcome-SB,

I am not sure what could cause the issue.
I’m asking our Embedded Team, they might have a better idea.

I’ll let you know as soon as I have more info.

Best,

Louis

Hi Louis,

Any updates?

Thanks,
Matthew

Hi @Matthew-Welcome-SB

We have it capped to 25 to give real world device estimations.

You can change the MAX Labels count from 25 to 35 etc, but this will impact the memory consumption.

// Redefine the EI_CLASSIFIER_MAX_LABELS_COUNT macro before the Edge Impulse SDK
#define EI_CLASSIFIER_MAX_LABELS_COUNT 35

Best

Eoin

Hey there. I’m working on a final year project that involves object detection and keyword spotting on an esp32s3 and I’d like to know if there’s any documentations with information related to issues like this (capping output classes at 25 for better efficiency) that I can reference in my research paper. Looking forward to hearing back from you.

Hello, matthew. Just wanted to enquire what microcontroller you used for this project. I’ll be using an esp32s3 n16r8 for mine and I’m trying to make performance comparison of different implementation setups.