cancel
Showing results for 
Search instead for 
Did you mean: 

Deploying the image classification model on the STM32N6570-DK got stuck, seeking help.

oet
Associate

Hello everyone,

I followed the following tutorial to deploy, but the compilation got stuck and didn't progress for a long time. I interrupted the process with Ctrl+C, and the window log is as follows. Can anyone help me figure out what's going on?

https://github.com/STMicroelectronics/stm32ai-modelzoo-services/blob/main/image_classification/deployment/README_STM32N6.md

 

logs:

Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

PS D:\TEST\stm32ai-modelzoo-services\image_classification\src> python stm32ai_main.py
[INFO] : Setting upper limit of usable GPU memory to 24GBytes.
[INFO] : Running `deployment` operation mode
[INFO] : ClearML config check
[INFO] : The random seed for this simulation is 123
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
[INFO] : Generating C header file for Getting Started...
loading model.. model_path="../../../stm32ai-modelzoo/image_classification/mobilenetv2/ST_pretrainedmodel_public_dataset/flowers/mobilenet_v2_0.35_128_fft/mobilenet_v2_0.35_128_fft_int8.tflite"
loading conf file.. "../../application_code/image_classification/STM32N6/stmaic_STM32N6570-DK.conf" config="None"
"n6 release" configuration is used
[INFO] : Selected board : "STM32N6570-DK Getting Started Image Classification (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
[INFO] : Compiling the model and generating optimized C code + Lib/Inc files: ../../../stm32ai-modelzoo/image_classification/mobilenetv2/ST_pretrainedmodel_public_dataset/flowers/mobilenet_v2_0.35_128_fft/mobilenet_v2_0.35_128_fft_int8.tflite
setting STM.AI tools.. root_dir="", req_version=""
Cube AI Path: "C:\Users\OET\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\10.0.0\Utilities\windows\stedgeai.exe".
[INFO] : Offline CubeAI used; Selected tools: 10.0.0 (x-cube-ai pack)
loading conf file.. "../../application_code/image_classification/STM32N6/stmaic_STM32N6570-DK.conf" config="None"
"n6 release" configuration is used
compiling... "mobilenet_v2_0_35_128_fft_int8_tflite" session
model_path : ['../../../stm32ai-modelzoo/image_classification/mobilenetv2/ST_pretrainedmodel_public_dataset/flowers/mobilenet_v2_0.35_128_fft/mobilenet_v2_0.35_128_fft_int8.tflite']
tools : 10.0.0 (x-cube-ai pack)
target : "STM32N6570-DK Getting Started Image Classification (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
options : --st-neural-art default@../../application_code/image_classification/STM32N6/Model/user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast --output-data-type float32
Traceback (most recent call last):
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\stm32ai_main.py", line 421, in <module>
main()
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\main.py", line 94, in decorated_main
_run_hydra(
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\_internal\utils.py", line 394, in _run_hydra
_run_app(
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\_internal\utils.py", line 457, in _run_app
run_and_report(
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\_internal\utils.py", line 220, in run_and_report
return func()
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\_internal\utils.py", line 458, in <lambda>
lambda: hydra.run(
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\clearml\binding\hydra_bind.py", line 91, in _patched_hydra_run
return PatchHydra._original_hydra_run(self, config_name, task_function, overrides, *args, **kwargs)
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\_internal\hydra.py", line 119, in run
ret = run_job(
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\clearml\binding\hydra_bind.py", line 195, in _patched_run_job
result = PatchHydra._original_run_job(*args, **kwargs)
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\hydra\core\utils.py", line 186, in run_job
ret.return_value = task_function(task_cfg)
File "C:\Users\OET\AppData\Roaming\Python\Python310\site-packages\clearml\binding\hydra_bind.py", line 230, in _patched_task_function
return task_function(a_config, *a_args, **a_kwargs)
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\stm32ai_main.py", line 407, in main
process_mode(mode=mode, configs=cfg, train_ds=train_ds, valid_ds=valid_ds, quantization_ds=quantization_ds,
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\stm32ai_main.py", line 302, in process_mode
deploy(cfg=configs)
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\../deployment\deploy.py", line 90, in deploy
stm32ai_deploy_stm32n6(target=board, stlink_serial_number=stlink_serial_number, stm32ai_version=stm32ai_version, c_project_path=c_project_path,
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\../../common/deployment\common_deploy.py", line 469, in stm32ai_deploy_stm32n6
stmaic_local_call(session)
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\../../common/deployment\common_deploy.py", line 443, in stmaic_local_call
stmaic.compile(session=session, options=opt, target=session._board_config)
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\../../common\stm32ai_local\compile.py", line 203, in cmd_compile
err, errorList = run_shell_cmd(cmd_line, logger=logger)
File "D:\TEST\stm32ai-modelzoo-services\image_classification\src\../../common\stm32ai_local\utils.py", line 278, in run_shell_cmd
line = process.stdout.readline() if process.stdout is not None else ''
KeyboardInterrupt
PS D:\TEST\stm32ai-modelzoo-services\image_classification\src>

 

Any guidance would be greatly appreciated!

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Julian E.
ST Employee

Hello @oet ,

 

I think I know the cause. 

The first time the st edge ai core is used (it is called by model zoo to convert your model to C code), it asks if you agree to share or not information and waits for you tipping y for yes or n for no. But when used inside model zoo, you don't see it.

 

Please locate "stedgeai" in your pc, open a terminal and run the following command:

./stedgeai generate --model MY_MODEL --target stm32n6 --st-neural-art

And at the end of it, when running the ST Edge AI Core the first time, it asks:

Do you allow statistics to improve the command line ? (y)es / (n)

After saying yes or no, the message never appears again, and model zoo should work.

 

Similar issue here if you need:

Solved: Re: Deploy an image classification model in STM32N... - STMicroelectronics Community

 

Let me know if it worked,

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.

View solution in original post

1 REPLY 1
Julian E.
ST Employee

Hello @oet ,

 

I think I know the cause. 

The first time the st edge ai core is used (it is called by model zoo to convert your model to C code), it asks if you agree to share or not information and waits for you tipping y for yes or n for no. But when used inside model zoo, you don't see it.

 

Please locate "stedgeai" in your pc, open a terminal and run the following command:

./stedgeai generate --model MY_MODEL --target stm32n6 --st-neural-art

And at the end of it, when running the ST Edge AI Core the first time, it asks:

Do you allow statistics to improve the command line ? (y)es / (n)

After saying yes or no, the message never appears again, and model zoo should work.

 

Similar issue here if you need:

Solved: Re: Deploy an image classification model in STM32N... - STMicroelectronics Community

 

Let me know if it worked,

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.