STMicroelectronics/stm32ai-modelzoo

Export onnx model error in stm.ai v8.1.0

aksunlight opened this issue · 3 comments

The error occurs when I export model yamnet_256_64x96.h5 in version 8.1.0 but not in version 8.0.0

`
PS D:\Softwares\en.x-cube-ai-windows_v8.0.0\windows> .\stm32ai.exe export-onnx -m yamnet_256_64x96.h5
Neural Network Tools for STM32AI v1.7.0 (STM.ai v8.0.0-19389)
elapsed time (export-onnx): 1.259s
PS D:\Softwares\en.x-cube-ai-windows_v8.0.0\windows> cd ....\en.x-cube-ai-windows_v8.1.0\windows
PS D:\Softwares\en.x-cube-ai-windows_v8.1.0\windows> .\stm32ai.exe export-onnx -m yamnet_256_64x96.h5
Neural Network Tools for STM32 family v1.7.0 (stm.ai v8.1.0-19520)

INTERNAL ERROR: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
`

LFOSTM commented

Hello,
A new version of the model zoo is available.
Can you make a try if you still reproduce the issue?
Thanks

The error still occurs with the new model
`
PS D:\Softwares\en.x-cube-ai-windows_v8.0.0\windows> .\stm32ai.exe export-onnx -m .\yamnet_256_64x96_tl.h5
Neural Network Tools for STM32AI v1.7.0 (STM.ai v8.0.0-19389)
elapsed time (export-onnx): 1.193s
PS D:\Softwares\en.x-cube-ai-windows_v8.0.0\windows> cd ....\en.x-cube-ai-windows_v8.1.0\windows
PS D:\Softwares\en.x-cube-ai-windows_v8.1.0\windows> .\stm32ai.exe export-onnx -m .\yamnet_256_64x96_tl.h5
Neural Network Tools for STM32 family v1.7.0 (stm.ai v8.1.0-19520)

INTERNAL ERROR: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
`

Hello, I've been able to reproduce your problem with X-CUBE-AI 8.1.0. The same issue also applies to all .h5 float32 models in the model zoo, so it isn't specific to this particular model.

As this is an issue with X-CUBE-AI and not the model zoo, and the export-onnx command isn't mentioned anywhere in the X-CUBE-AI documentation (though it does show up in the 8.1.0 CLI help), your issue has been forwarded internally to the appropriate team. I will update this issue when I have more information.

In the meantime, if you want to convert a Keras model from the zoo to ONNX, you can use tf2onnx