cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-AI: error while analyzing model

ABora.3
Associate II

Hi,

I have followed the tutorial https://www.youtube.com/watch?v=grgNXdkmzzQ&t=4s to test X-CUBE-AI with CubeMX5.0.1, but the step 'Analysis' just end with an error message without any details. I have received the same error with CubeIDE which comes with integrated CubeMX.

If I try to run 'Analysis' of the same model after selecting the board I receive the error as shown below. Could anyone please help me in figuring out where could be the problem? Do I require to install Python to run X-Cube-AI? That is not mentioned in the users manual or tutorial.

Thank you in advance!

Achyut

The error:

--------------

Analyzing model 

Neural Network Tools for STM32 v1.1.0 (AI tools v4.1.0) 

TOOL ERROR: Traceback (most recent call last): 

  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper 

  File "imp.py", line 296, in find_module 

ImportError: No module named '_pywrap_tensorflow_internal' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 

  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> 

  File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module 

  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> 

  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper 

  File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module 

ImportError: DLL load failed with error code -1073741795 

Failed to load the native TensorFlow runtime. 

See https://www.tensorflow.org/install/errors 

for some common reasons and solutions.  Include the entire stack trace 

above this error message when asking for help.

14 REPLIES 14
fauvarque.daniel
ST Employee

Can you share the model you are importing using the tool ?

Thanks in advance

Regards

Daniel

ABora.3
Associate II

Hi Daniel,

thanks for prompt reply from you! Attached please find the model. I downloaded the model from https://github.com/Shahnawax/HAR-CNN-Keras/blob/master/model.h5 and just renamed following the demonstration in the YouTube link.

I have not tried out with any other model though.

Thanks again

Regards

Achyut

fauvarque.daniel
ST Employee

Ok, this is the one from the training, it should pass without any problem, sounds more like an Windows / environment problem.

To answer your question there is no python prerequisite, the installation comes with all the precompiled modules that we need.

Are you on Windows 10 or still on Windows 7 ?

ABora.3
Associate II

Hi Daniel,

Thanks a lot for clarification!

It's a Windows 7 machine.

I have tried by updating PATH environment inserting C:\Users\<user name>\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\4.1.0\Utilities\windows. The same error still appears. I have tried with stm32ai command line interface too using the following command:

stm32ai analyze -m <model_file_path> -c 4

which again throws the same error.

I have just noticed that in CLI the following tools_version checking command fails too

> stm32ai --tools_version

which throws similar error

However, this one works

> stm32ai --version

which returns 'stm32ai - Neural Network Tools for STM32 v1.1.0 (AI tools v4.1.0)'.

Best regards

Achyut

fauvarque.daniel
ST Employee

The build from the sources is done on a Windows 10 machine, in the user manual (UM2526) we explicitly mention a minimum version of Windows 10.

Regards

Daniel

Hi Daniel,

Many thanks! It's clear now.

For me with Windows 7 I will try with an older version of X-CUBE-AI.

Best regards

Achyut

AlessioBurrello
Associate

Hi,

I had the same issue using Windows 10 Home 1909. On the manual (UM2526), the only requirements that I saw is Windows 10.

Here is the trace of the error, trying both with a custom network or with the one of the example:

eural Network Tools for STM32 v1.1.0 (AI tools v4.1.0)

 [AI:cifar10net] TOOL ERROR: Traceback (most recent call last):

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper

 [AI:cifar10net]  File "imp.py", line 296, in find_module

 [AI:cifar10net] ImportError: No module named '_pywrap_tensorflow_internal'

 [AI:cifar10net]  

 [AI:cifar10net] During handling of the above exception, another exception occurred:

 [AI:cifar10net]  

 [AI:cifar10net] Traceback (most recent call last):

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>

 [AI:cifar10net]  File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper

 [AI:cifar10net]  File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

 [AI:cifar10net] ImportError: DLL load failed: Routine di inizializzazione della libreria di collegamento dinamico (DLL) non riuscita.

 [AI:cifar10net]  

 [AI:cifar10net]  

 [AI:cifar10net] Failed to load the native TensorFlow runtime.

 [AI:cifar10net]  

 [AI:cifar10net] See https://www.tensorflow.org/install/errors

 [AI:cifar10net]  

 [AI:cifar10net] for some common reasons and solutions. Include the entire stack trace

 [AI:cifar10net] above this error message when asking for help.

 [AI:cifar10net] Analyze fail on the AI model

 [AI:cifar10net] Neural Network Tools for STM32 v1.1.0 (AI tools v4.1.0)

 [AI:cifar10net] TOOL ERROR: Traceback (most recent call last):

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper

 [AI:cifar10net]  File "imp.py", line 296, in find_module

 [AI:cifar10net] ImportError: No module named '_pywrap_tensorflow_internal'

 [AI:cifar10net]  

 [AI:cifar10net] During handling of the above exception, another exception occurred:

 [AI:cifar10net]  

 [AI:cifar10net] Traceback (most recent call last):

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>

 [AI:cifar10net]  File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>

 [AI:cifar10net]  File "site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper

 [AI:cifar10net]  File "c:\python35\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

 [AI:cifar10net] ImportError: DLL load failed: Routine di inizializzazione della libreria di collegamento dinamico (DLL) non riuscita.

 [AI:cifar10net]  

 [AI:cifar10net]  

 [AI:cifar10net] Failed to load the native TensorFlow runtime.

 [AI:cifar10net]  

 [AI:cifar10net] See https://www.tensorflow.org/install/errors

 [AI:cifar10net]  

 [AI:cifar10net] for some common reasons and solutions. Include the entire stack trace

 [AI:cifar10net] above this error message when asking for help.

 [AI:cifar10net] Analyze fail on the AI model

Best regards,

Alessio Burrello

EZeli.1
Associate II

Hi Alessio, did you actually solve this problem? I have actually been stuck at the same issue for a few days, do you have any suggestion on how to solve it? I found some other similar problems to this but none of them was answered with a solution.

tcg
Associate III

Hi, i have the same problem.

I can generate an analysis base on comand windows in cmd console.

 ------ ----------------- ------------------------- ------------------------- ------

 macc=6,532,325 weights=626,620 act=259,200 ram_io=3,300

Creating txt report file C:\WINDOWS\system32\stm32ai_output\network_analyze_report.txt

elapsed time (analyze): 113.465s

But it is not posible to obtain by cube mx


_legacyfs_online_stmicro_images_0693W00000bl3o6QAA.png Any idea about how obtain at least the log failed test.

Thanks a lot for your time, T