ShuffleNet support on OpenMV

Hi,
I have tried several well-known networks (such as MobileNet, ResNet, LeNet, SqueezeNet) on Open MV Cam H7 Plus and the board works perfectly, but, when I’m testing the ShuffleNet tflite model, a hard crash appening (the program stops, LED blinks in green for a few times and afterwards it blink white).
I have first thinked to a memory problem since ShuffleNet is 4MB big, but then I have tried the other models previously mentioned, that are are also bigger (e.g. ResNet is 13 MB), and they work well.
Moreover, I have analized this model with STM32CubeMX X-CUBE-AI (using STM32H743II MCU) and the log reports “INTERNAL ERROR” without any other information, while with the other models the analyze process successfully ends.
Since ShuffleNet uses pointwise group convolutions and channel shuffle, I think that the error could be that these layers are not yet supported.
Could anyone confirm me this or is there another reason?

Thank you in advance.

1 Like

TensorFlow light for Microcontrollers has bugs. In particular, you are likely running into issues with cmsisnn and the low effort port ARM did of the code.

For example, the folks who made it did things like having statically sized buffers for arrays and then would put a variable sized array into that static buffer. If the input array was smaller than the static buffer… all good… if bigger, then a hard crash like you are happening.

It took several months to find this issue. However, it’s likely that you are running into something like this in the code.

Can you ping Edge Impulse about this issue you are having? They found the bug the last time. Unfortunately, I can only help you with our wrapper code around TensorFlow. If you are getting a hard crash then it’s inside TensorFlow. You’d get a nice error message if it was an out of memory issue or an unsupported layer.

Hi, I am also stuck with the same situation where I tried a few other models on OpenMV H7 but only the shufflenet is throwing the problem. I first thought its due quantized model but tried with fp32 model and error still remains. Honestly, I think the same that few ops are not supported but if you consider channel shuffle its just reshape-transpose-reshape op so not sure. If anyone found the solution please let us know.
Thanks!

Hi, the op needs to be in this list:

1 Like

We can add more ops but they use flash space which is at a premium. So, I just have the ops enabled for support Edge Impulse models.

1 Like

Hi @kwagyeman,
Thank you for this reference. As I can see, all my ops are in this list-
micro_op_resolver.AddConv2D();
micro_op_resolver.AddRelu();
micro_op_resolver.AddMaxPool2D();
micro_op_resolver.AddQuantize();
micro_op_resolver.AddStridedSlice();
micro_op_resolver.AddConcatenation();
micro_op_resolver.AddShape();
micro_op_resolver.AddPack();
micro_op_resolver.AddReshape();
micro_op_resolver.AddTranspose();
micro_op_resolver.AddDepthwiseConv2D();
micro_op_resolver.AddAveragePool2D();
micro_op_resolver.AddMean();
micro_op_resolver.AddFullyConnected();
micro_op_resolver.AddSoftmax();
micro_op_resolver.AddAdd();

And they aren’t commented out in the file I sent you?

Hi @kwagyeman,
Yes most of them are commented! Thanks for the help I will try to use different model that has supporting ops.

hi laura please can you tell me if you did change in the structure of the layers in the model of squeezenet because im facing the same issue