cancel
Showing results for 
Search instead for 
Did you mean: 

the result of onnx model validate on target has two different output, why?

cxf
Associate III

hi

I have validate on the STM32N6 board by onnx model in STM32MX,but i have two different output ,like this:

 m_outputs_1: (10, 3)/float64, min/max=[-282.578064, 481.370483], mean/std=[-2.619613, 298.301398], output  m_outputs_2: (10, 1)/float64, min/max=[0.000000, 0.000000], mean/std=[0.000000, 0.000000], node_139  c_outputs_1: (10, 1, 1, 3)/float32, min/max=[-4.547175, 5.813805], mean/std=[0.008044, 4.321293], output  c_outputs_2: (10, 1, 1, 1)/float32, min/max=[0.000800, 0.000800], mean/std=[0.000800, 0.000000], node_139

the  m_outputs_1 is error, and c_outputs_1 is correct,why? what can lead to this problem?

please help me ,thanks very much!!!

I have upload the report.txt and onnx model in the attach.

25 REPLIES 25

hi @Julian E. 

Thanks for you help very much!

Now i have follow your way ,and when I validate on taget,I don not select the Enabled button.(because I have flash the weight to the external flash on 0x71000000 by  STM32cubeProgrammer before)

cxf_0-1754276615579.png

 

and get the result like this :

 

cxf_1-1754276767960.png

 

I do not know why the two results are different?

I really want to prove your results which the two results are almost the same ,please help me !

As your result like this:

cxf_2-1754277282257.png

 

 Thanks!!!

By the way, i put my report in the attach.  

Hello @cxf,

 

The validate command is meant to work with the application of the n6_loader.py (that you load if you check the enabled).

 

In your case, I think that you are comparing the wrong things.

 

Please check the enable case and validate the results of your model and then do your custom application.

 

The weights being in external flash is not an issue.

 

Have a good day,

Julian

 


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.

hi @Julian E. 

Thanks for you help very much!

I have check the Enabled button and validate on target ,but i get a error from  stm32cubeMx,like this:

cxf_0-1754361953085.png

but I have check that there is the ST-LINK_gdbserver.exe in 

E:\ST\STM32CubeIDE_1.18.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.2.100.202501151542\tools\bin, like this :

cxf_1-1754362093170.png

and i also put this route into  path table of windows system environment variables, like this:

cxf_2-1754362360525.png

but i have not solve this problem.

Why?how can i  solve this problem?

Thanks!!!

 

Hello @cxf,

 

Can you try to edit the config.json in:

C:\Users\<your_user>\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\10.2.0\scripts\N6_scripts\

or if you manually installed the st edge ai core in:

C:\ST\STEdgeAI\2.2\scripts\N6_scripts

 

In the config.json, please make sure that the gdb_server_path is correct:

JulianE_0-1754381327596.png

 

Have a good day,

Julian


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.

hi @Julian E. 

 

I found the config.json in ...\X-CUBE-AI\10.2.0\scripts\N6_scripts,and edit it like this :

 

"gdb_server_path": "E:/ST/STM32CubeIDE_1.18.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_2.2.100.202501151542/tools/bin",
    "gcc_binary_path": "E:/ST/STM32CubeIDE_1.18.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0.0.202411081344/tools/bin",
    "objcopy_binary_path": "E:/ST/STM32CubeIDE_1.18.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.13.3.rel1.win32_1.0.0.202411081344/tools/bin",
    "cubeide_path": "E:/ST/STM32CubeIDE_1.18.1/STM32CubeIDE",
    "compiler_type": "gcc",
    "cubeProgrammerCLI_binary_path": "E:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI.exe",
    "iar_binary_path": "C:/Users/foobar/TOOLS/IAR/IAR9.30.1/common/bin/"
 
but when i validate on target, i get the same problem again.
What's even stranger is that the value of "cubeide_path" has turns into "", I check that it is modified by the action of validate on target!
 
please help me thanks!

Hello @cxf,

 

It is pretty strange. 

CubeMX is automatically using the n6_loader script. I propose you to try to do it manually to locate the source of the issue (the script or cubeMX)

 

Could you please try to do the validation on target manually? 

To do so:

  1.  Go to: C:\Users\<your_user>\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\10.2.0\scripts\N6_scripts\
  2. Copy your model to the model folder (or directly in N6_script folder)
  3. Run the generate command:
    stedgeai generate -m your_model --target stm32n6 --st-neural-art 
  4. Run the n6_loader.py script with DK board plugged in dev mode: 
    python n6_loader.py
  5.  Run the validate on target command:
    stedgeai validate -m your_model --target stm32n6 --mode target -d serial:921600

You can use your custom input and output during the validate.

 

If it does not work, please share the compile.log and n6_loader.log that you will generate.

 

Have a good day,

Julian


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.

hi @Julian E. 

 

Thank you for your help very much!

Now i follow  your advice,and can execute to  third step,but when I execute the fourth step,it get the same problem like this:

cxf_0-1754549664374.png

There is no compile.log,i only find n6_loader.log,but it is empty(0KB).like this:  

cxf_1-1754550011577.png

 

Now i really do not know how to solve this problem,please help me  thanks!!!  

 

 

SlothGrill
ST Employee

Hello
Can you paste the end of the traceback in your screenshot above ? please?

(i.e. the above exception was the direct cause .... up to the end ?)

+ if this does not help (i.e. if the cubeide path mentionned here is the one your are expecting), you can raise the verbosity of scripts by setting .setLevel(logging.DEBUG) in both n6_utils_pkg/config_reader.py (line 14) oand n6_utils_pkg/cubeIDE_toolbox.py (line 15), this will help find the issue.

 

Possible fix is to remove your  "cubeide_path""E:/ST/STM32CubeIDE_1.18.1/STM32CubeIDE", line from the config file and see if it works better. (though it would be better to understand what's not good about your config here..)

Hi @SlothGrill 

Thank you for your help very much!

Now, i have follow your advice ,and modify the two py like this:

cxf_0-1754877443634.png

 

cxf_1-1754877499749.png

 

and the cubeide_path has been set to "",when I run the n6_loader.py, result can be get in the attach.

please help me thanks !

 

 

 

SlothGrill
ST Employee

hello
Thanks for the log could you further help to find what is going on:

  • In a shell, if you go to `...\X-CUBE-AI\10.2.0\scripts\N6_scripts` , what is the output of `which stm32cubeide` ?
  • Based on the outputs, i guess the cubeide_path has been set to ".", i'm not sure what could have led to this... do you have another line with cubeide_path in your config.json ? 
  • Can you try running python n6_loader --help
  • You can also try to force the cubeidepath on the commandline and see if the behaviour is different (it should not be)
  • did you try to remove the cubeide_path line from your config.json ?

Do you know what shell you are running by default ? 

Do you run a clean install of stedgeai or did you tweak it in some way (or eg. migrate from an old version to a new one ?)

 

Sorry, from the outputs this is not clear what is going on :\

Best regards.