Skip to main content
ABora.3
Associate
November 5, 2019
Question

X-CUBE-AI: error while analyzing model

  • November 5, 2019
  • 13 replies
  • 5286 views

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.

    This topic has been closed for replies.

    13 replies

    fauvarque.daniel
    ST Employee
    November 5, 2019

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

    Thanks in advance

    Regards

    Daniel

    ABora.3
    ABora.3Author
    Associate
    November 5, 2019

    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
    November 5, 2019

    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
    ABora.3Author
    Associate
    November 5, 2019

    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
    November 5, 2019

    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

    ABora.3
    ABora.3Author
    Associate
    November 5, 2019

    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
    Visitor II
    November 26, 2019

    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
    May 16, 2021

    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
    May 29, 2023

    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

    fauvarque.daniel
    ST Employee
    May 29, 2023

    Can you reproduce the problem with a recent verstion of STM32CubeMX and X-CUBE-AI ?

    You may want to also look at STM32CubeMX log located under ~/.stm32cubemx/STM32CubeMX.log it should give more details.

    Regards

    tcg
    Associate III
    May 29, 2023

    I have the most recent sw.

    An I can generate in cmd windows console but it is not possible run with Cubemx.

    And Empty error appears. Any information appears in that log file.

    Kind regards, T

    @fauvarque.daniel​  


    _legacyfs_online_stmicro_images_0693W00000bl3x3QAA.png
    _legacyfs_online_stmicro_images_0693W00000bl3uYQAQ.png
    _legacyfs_online_stmicro_images_0693W00000bl3wZQAQ.png