STMicroelectronics / stm32ai-modelzoo

AI Model Zoo for STM32 devices
Other
236 stars 64 forks source link

INTERNAL ERROR: Mismatch in input shape of gemm: (BATCH: 1, CH: 12, H: 8) x (BATCH: 1, CH: 8, H: 12) #36

Closed abldsd closed 3 weeks ago

abldsd commented 3 weeks ago

Hi, I am trying to deploy a pytorch deep learning to stm32. I first converted it to an onnx model and after that verified it in STM32Cube.AI Developer Cloud and in the middle step of optimize it reported the following error.

stm32ai analyze --model trans_model_8.onnx --allocate-inputs --allocate-outputs --compression none --optimization balanced --target stm32f4 --name network --workspace workspace --output output STEdgeAI Core v9.0.0-19802 INTERNAL ERROR: Mismatch in input shape of gemm: (BATCH: 1, CH : 12, H: 8) x (BATCH: 1, CH: 8, H: 12)

When I look at the model visualization in netron I see that the gemm operation is only present in the last linear layer, but that operation is converting 1x702 data to 1x2. I don't know if there's something I'm missing.Would be great if you could assist me in resolving this issue.

Thank you!

LFOSTM commented 3 weeks ago

Hello, It seems to be an issue related to STM32Cube.AI / STEdgeAI, not to the model zoo. You can enter your issue here : https://community.st.com/t5/edge-ai/bd-p/edge-ai Regards, Laurent