Error analyzing ONNX model with GRU layer in STM32Cube.AI v2.0.0
- April 30, 2025
- 1 reply
- 472 views
Hello ST Community/Support,
I am encountering an issue when trying to analyze an ONNX model containing a GRU layer using STM32Cube.AI.
- Tool Version: STM32Cube.AI v2.0.0-20049 .
- Model Type: A neural network model with a GRU layer followed by a Dense (fully connected) layer.
- Model Format: ONNX, exported from PyTorch.
- Error Occurs: During the "Analyzing Network" phase in STM32Cube.AI.
- Target MCU: STM32H7 series.
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.
