Error while analyzing Keras model with X-CUBE-AI (DLL load failed)
Hi, I have installed STM32 cube IDE and the latest version of CUBE AI software pack to convert a pretrained neural nework implemented and trained with Keras/TF. After creating a project, when I try to add a network from a saved model.h5 from the file system, when I try to analyze it I have the following error:
Analyzing model
C:/Users/<username>/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/6.0.0/Utilities/windows/stm32ai analyze --name network -m C:/Users/<username>/facedetection/pnet.h5 --type keras --compression 1 --verbosity 1 --workspace C:\Users\<username>\AppData\Local\Temp\mxAI_workspace85208706500011701743944848630527 --output C:\Users\<username>\.stm32cubemx
[456] Failed to execute script stm32ai
Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: Routine di inizializzazione della libreria di collegamento dinamico (DLL) non riuscita.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "stm32ai.py", line 376, in <module>
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "irs\objects\ai_layer_factory.py", line 22, in <module>
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "irs\objects\layers\bidirectional.py", line 23, in <module>
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "irs\objects\layers\gru.py", line 24, in <module>
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "irs\objects\layers\recurrent_layer.py", line 24, in <module>
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "utilities\keras_utilities.py", line 28, in <module>
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow
File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
File "tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: Routine di inizializzazione della libreria di collegamento dinamico (DLL) non riuscita.
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
The above error can be translated as:
ImportError: DLL load failed: DLL initialization routine failed.
This it the STM32CubeIDE version:
Version: 1.6.1
Build: 9958_20210326_1446 (UTC)
My OS is windows 10. I already tried to install the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019, but nothing changed.
Do you have any suggestion about what could be wrong in my environment setup?
Thanks,
Enrico
