Audio classification on Raspberry pi 5 - Error: Classifying failed, error code was -5

Question/Issue:
While deploying the audio classification model on a raspberry pi zero and 5, I’m getting Error: Classifying failed, error code was -5.

Project ID:
relay-v4

Context/Use case:
I’m trying to run an audio classification model on a raspberry pi zero or raspberry pi 5. I’m able to successfully build the model for deployment on linux AARCH64 (for pi 5) and AARCHv7, but when i run the model using the edge-impulse-linux-runner command, the model fails with error code -5. I have a usb mic attached to the pi which get recognized by the model and i have tuned it to match the input frequency required for the model and have played around with different windowing samples.

Steps Taken:

  1. Build model for different linux architecture to run on pi 0 and pi 5
  2. Tried to run on a windows pc, but still getting same error
  3. Tried different usb and serial mic
  4. Tried to recreate the model

Expected Outcome:
model should be able to classify audio samples in live env.

Actual Outcome:
Error: Classifying failed, error code was -5
at LinuxImpulseRunner.classifyContinuous (/usr/local/lib/node_modules/edge-impulse-linux/build/library/classifier/linux-impulse-runner.js:326:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async onData (/usr/local/lib/node_modules/edge-impulse-linux/build/library/classifier/audio-classifier.js:84:35)

Reproducibility:
Always

Environment:

  • Platform: RPI 0, RPI 5 (16GB)
  • Build Environment Details: Linux AARCH64, Linux AARCHv7
  • OS Version: [Raspbian OS, tried both- 32 bit and 64 bit]
  • Edge Impulse Version (Firmware): [1.22.0]
  • To find out Edge Impulse Version:
  • if you have pre-compiled firmware: run edge-impulse-run-impulse --raw and type AT+INFO. Look for Edge Impulse version in the output.
  • if you have a library deployment: inside the unarchived deployment, open model-parameters/model_metadata.h and look for EI_STUDIO_VERSION_MAJOR, EI_STUDIO_VERSION_MINOR, EI_STUDIO_VERSION_PATCH
  • Edge Impulse CLI Version: [1.22.0]
  • Project Version: [1.0.0]
  • Custom Blocks / Impulse Configuration: [impulse configuration]
    Logs/Attachments:
    included above

Hi @harshyadav2402 - thanks for posting!

The error code -5 refers to an EI_IMPULSE_DSP_ERROR. I am going to update this return types doc to include the error code numbers for easier lookup.

I’ll take a look at your project, focusing on the processing block, and see if there is anything that I notice.

hey @harshyadav2402

I’ve found the issue and will roll out a fix to prod, will probably land tomorrow or the next day. In the meantime, there’s a workaround that maybe would lead to better feature extraction anyway. You have the number of cepstral coefficients (the size of the final DCT step) set to 256. That’s quite high, is there a reason you’re trying that?

I believe our default is 13, and I’ve never really seen a use case for a number as high at 256. So maybe start with our default. If you’re playing with parameters b/c you’re not getting good accuracy, tag me on the forum and I can give you some other ideas…I don’t think pushing this parameter that high will help you.

At any rate, we will either catch this value and error, or fix it in the SDK, fyi. But I don’t think it’s helping you to set it that high.

1 Like

Were you able to resolve your issue, @harshyadav2402? The fix should be in prod now, so it’s worth giving it another go.