cancel
Showing results for 
Search instead for 
Did you mean: 

Which Intermediate Representation Version needed - ONNX & X-Cube-AI/ST Edge AI Cloud

MoCo
Associate II

Dear Sir or Madam,

I'm trying to import a ONNX network with X-Cube-AI(9.1)/ST Edge AI Cloud which was generated and exported using Matlab/Simulink. When trying to work with the model I always receive the following error:

[... ST Edge AI Core v1.0.0-19894 
INTERNAL ERROR: Your model ir_version is higher than the checker's.

...] - same error in X-Cube-AI(9.1) and ST Edge AI Cloud.

The intermediate representation version of the Matlab/Simulink generated ONNX Model is 9 and I choose OpsetVersion to be 13 (recommendation somewhere in the docs). Attached is an example of the file I would like to import.

Now it would be interesting for me to know which intermediate representation version is required by X-Cube-AI(9.1)/ST Edge AI Cloud? Then I can convert the onnx file to the correct ir version.

Which ONNX version is the basis for X-Cube-AI(9.1)/ST Edge AI Cloud?

 

Have a nice day and best regards,

MoCo

 

STM32CubeAI  ST Edge AI Developer Cloud 

1 ACCEPTED SOLUTION

Accepted Solutions
hamitiya
ST Employee

Hello @MoCo ,

You can find all the embedded versions with this command:

$ ./stedgeai.exe --tools-version
stedgeai - ST Edge AI Core v1.0.0-19894
- Python version : 3.9.13
- Numpy version : 1.23.5
- TF version : 2.15.1
- TF Keras version : 2.15.0
- ONNX version : 1.10.2
- ONNX RT version : 1.17.3

 

I tried your model with our development version and it is working as expected.

Could you please try to downgrade your op_set to see if the behavior change ?

For your information, with our development version:

hamitiya_0-1732782164174.png

 

Best regards,

Yanis


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
hamitiya
ST Employee

Hello @MoCo ,

You can find all the embedded versions with this command:

$ ./stedgeai.exe --tools-version
stedgeai - ST Edge AI Core v1.0.0-19894
- Python version : 3.9.13
- Numpy version : 1.23.5
- TF version : 2.15.1
- TF Keras version : 2.15.0
- ONNX version : 1.10.2
- ONNX RT version : 1.17.3

 

I tried your model with our development version and it is working as expected.

Could you please try to downgrade your op_set to see if the behavior change ?

For your information, with our development version:

hamitiya_0-1732782164174.png

 

Best regards,

Yanis


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
MoCo
Associate II

Dear Yanis,

thanks a lot for your great help!

I was able to retrieve the version of ONNX which is important to allow conversion.

stedgeai - ST Edge AI Core v1.0.0-19894
- Python version : 3.9.13
- Numpy version : 1.23.5
- TF version : 2.15.1
- TF Keras version : 2.15.0
- ONNX version : 1.10.2
- ONNX RT version : 1.17.3

I tried to change the opset down to 6 (in steps of one) from the current 13 - but that changes nothing.

 

Under https://onnxruntime.ai/docs/reference/compatibility.html you can see that  IR version 9 was introduced with ONNX version 1.14. This means that with the current ONNX 1.10.2 we have in tIR version 8 you require with stedgeai - is that true? 

Then my path would be to install ONNX version 1.14/1.15 an try to downgrade the IR version from 9 to 8.

I have only one remaining question - can you give me an rough estimate when the release of the new version will happen (is a beta test possible)?

 

Many thanks and best regards

MoCo

hamitiya
ST Employee

Hello @MoCo ,

If op_set does not correct your issue, then you may try to downgrade your ONNX install. As I can see, IR_VERSION is set to 8 in our installation:

From onnx_ml_pb2.py embedded in ONNX package:

IR_VERSION = 8

 For the next release, I cannot say much but I can share you a hint, so stay tuned !

https://www.st.com/content/st_com/en/events/stm32-summit.html

 

Best regards,

Yanis


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello Yanis,

thanks a lot - you and the team developing this software are doing are great job.

I'm looking forward to the release.

 

I found a simple fix - I installed Matlab R2024a and did the export with it (ir version = 7) - that works great.

 

Best regards and have a nice rest of the week,

MoCo

Glad it helped !


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.