2025-04-29 7:07 PM
Hello ST Community/Support,
I am encountering an issue when trying to analyze an ONNX model containing a GRU layer using STM32Cube.AI.
The specific error messages I receive in the Output window are:
TOOL ERROR: operands could not be broadcast together with shapes (1024,) (512,).
I understand that GRU layers are complex operations. It seems that Cube.AI's internal analysis or decomposition of the GRU layer is encountering a shape mismatch during an attempted element-wise operation (broadcasting).
Could you please help me understand the cause of this error? Does STM32Cube.AI v2.0.0 have specific limitations regarding GRU layers or the broadcasting of operands within complex operations like those in GRU? Is there a recommended way to structure or export ONNX models with GRU for Cube.AI to be able to process them correctly?
I can provide the ONNX model file (model.onnx) if needed for debugging.
Thank you for your assistance.
2025-05-06 12:42 AM
Hello Kiki,
As you said, GRU is quite complex, and we are still trying to reach for the support of as many gru configs as possible.
Here you can find the known limitations that applies for GRU layers when providing an ONNX model: ONNX toolbox support
However, it looks like your model falls in a bug of stedgeai reported recently: STEdgeAI does not manage to properly import ONNX-GRU layers with the linear_before_reset attribute set.
This bug is currently under fix on the development side.
Sorry for the inconvenience.
Best regards.