ERR: Failed to run DSP process (-1004) spectrogram

I tried using the example stand alone inference master to use my model in my Windows PC but i get this error.

ERR: Failed to run DSP process (-1004)
run_classifier returned: -5
Begin output
[0.00000, 0.00000]
End output

The model classifies using the spectrogram block
How can I fix this?
I appreciate the help

Hello @davidib19,

-1004 is actually EIDSP_MATRIX_SIZE_MISMATCH - so the raw feature buffer passed into the function is the wrong size.

From this documentation link: https://docs.edgeimpulse.com/docs/running-your-impulse-locally, it is asked to copy the raw features and then pass them as an argument to the following command: build\edge-impulse-standalone.exe "paste-here-what-you-copied".

Can I make sure you did that correctly before investigating further?

Regards,

Louis

Hello Louis,

I copied the raw features from the live classification section of the Edge Impulse page and I tried pasting that directly on the Command Prompt window, I also tried creating a txt file to pass as the argument; both got the same error.

When I used the spectral features block it worked fine and I used the exact same data so I think it has something to do with the spectrogram block.

Hello @davidib19,

Can you tell me which one of your project is having the issue?
I can see several under your account.

Regards,

Louis

Sure,
It´s tortugas v2 spectrogram

Thank you very much

Thanks,

So from what I see, you (or the EON tuner) have set a windows size around 24 seconds:

However, when I first test in live classification, I noticed that some of your samples were not able to get classifed correctly:

This is because some of your samples are shorter than 24 seconds:

So you could actually stack some of the raw features until you get 140 features and then try to classify it. Otherwise you’ll need to copy the raw features from the live classification page on a sample that is longer than 24 seconds, the live classification is actually automatically selecting the right number of features for you as you can see in the grey rectangle.

Let me know if you have some more questions,

Regards,

Louis

Hello @Louis,

I copied the raw features from a sample that was longer than 24 seconds when I got this error.

Hello @davidib19,

Ok I’ll run it on my side locally to see if there is something else.

Regards,

Louis

Hello @davidib19,

So I do have the same issue, checking internally what could be the issue.

Regards,

Louis

@davidib19 First I’d enable padding on the time-series block (on Create impulse) so you train with everything. Then, can you check that the amount of features you pass in actually matches the 24 seconds? If not you need to pad with 0’s as well.

Will take a look at this on Wednesday as well if still needed.

Hello @davidib19,

@rjames and I have been looking a bit deeper into it.

First, spectrogram does not accept at the moment more than one axis. We’ll work either on supporting it or add a option to select which axis you want to work with and you’ll need to duplicate your spectrogram block for each axis.
We have an internal ticket that has been created. In the meantime, you can do something similar to this:

This will let you run the C++ library from the example-standalone-inference.

However, this lead to another issue on our side when we noticed that the live classification results and the inference results given by the C++ SDK are not the same when have multiple spectrogram dsp blocks.

@rjames is still investigating on the second issue and we will let you know as soon as we have more details.

Thanks for reporting this issue.

Regards,

Louis

Thank you so much @louis,

So it supports the tree axes correctly in the web page but not in the c++ stand alone?

Also, I’d like to use the c++ library as a function in another code instead of using it as an executable. Would you please tell me if this is possible and if you have an example of how to do this it would be great!

Thanks for the help.

Regards,

David

Hi @davidib19 Correct, we have a long standing open ticket to fix it. You can create three different spectrogram blocks on the create impulse screen and wire them into a single neural network block - that’d work and basically does the same.

https://docs.edgeimpulse.com/docs/running-your-impulse-locally-1 <-- docs on how to integrate into another application.

Hi @janjongboom
I tried creating the three different spectrogram and now the standalone exe works, but it gets the classification all wrong. I copied the raw features of this window: (The one with the blue background)


And the stand-alone.exe showed this input:
image

It happened with other windows too.

Hi @davidib19,

Yes that’s correct I’ve notice the same. I’m looking into it.

Hi @davidib19 we traced down the issue to the handling of non-round frequencies (like you have here). @Arjan has pushed a fix, will be live tomorrow or the day after!

I tried it and it works! Thank you very much!
I just have one final question, aren’t these frequency values in the spectrogram y axis weird? Is it normal that it only shows frequencies between 0 and 3 Hz?
image

Regards

1 Like

Hi @davidib19,

The spectrogram is based on FFT created with 1/2 the sampling frequency. In your project the sampling frequency is 5.747126… Hz which is rounded to 3 Hz for FFT.

1 Like

Hello
I’m having trouble with the classification on this model again. I tried running it in the Arduino 33 BLE SENSE with the built firmware and I always get the same result, whether I use it or not. It also happened with the c++ library on my desktop.
This is a screenshot of the result I get with the arduino.

Hello David
I have the same problem. It seems that I don’t get the relevant classification labels in the terminal.
Would you please share your workaround?