Cannot set tensor: Dimension mismatch. Got 2 but expected 4 for input 0

I was following this guide:

Once I got to live classification, I kept getting the error:
Cannot set tensor: Dimension mismatch. Got 2 but expected 4 for input 0.

Project ID: 174002

I’m trying to get this to detect boiling water. I’m using the Arduino Nano RP2040 Connect for my device.

Hi @ashvin540,

What Sample Length and Window Size are you using?

Best

Eoin

Hello, @ashvin540!
I was not able to reproduce the issue you’re describing on your project - both samples in Live classification can be classified without errors.

Hi @ashvin540,

On further checking, it looks like the Classifier was changed from the suggested one at some point. This could have caused the strange error you saw.

The Classifier is set to a Hardware Specific one for BrainChip:
Impulse Design > Create Impulse
Classification (Keras) - BrainChip Akida™

Can you try changing to the Suggested on, rerun your training, and try live classification:
Impulse Design > Create Impulse

This should allow you to perform live classification on the nano.

Best

Eoin

Hi everyone, sorry for the late response, but I found out the issue. I changed the classifier to the one that Edge Impulse recommended. In the tutorial, they said to use:

“Classification (Keras)”

I changed it now, but I don’t get why the previous one didn’t work. Anyways, thank you all for the help.

1 Like