Dimsmary / Ossas_ChatBot

chatbot with Keras
MIT License
455 stars 64 forks source link

出现fail to load the native tensorflow runtime #20

Open hftvdd opened 4 years ago

hftvdd commented 4 years ago

我电脑上同时有32位python3.7和64位python3.6,只有后者安装了能够正常import的TensorFlow。但是ossas.exe貌似默认使用python3.7并抛出错误。如何解决? ’C:\Users\a>C:\Users\a\Desktop\chatbot\OSSAS.exe c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py:489: Matp lotlibDeprecationWarning: The MATPLOTLIBDATA environment variable was deprecated in Matplotlib 3.1 and wil l be removed in 3.3. Traceback (most recent call last): File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_impor t_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 "tensorflow\python\pywrap_tensorflow.py", line 58, in File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_impor t_helper ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 5, in File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module File "Seq2Seq.py", line 8, in File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module File "tensorflow__init.py", line 40, in File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module File "tensorflow\python\init__.py", line 49, in File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module File "tensorflow\python\pywrap_tensorflow.py", line 74, in ImportError: Traceback (most recent call last): File "tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_impor t_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 "tensorflow\python\pywrap_tensorflow.py", line 58, in File "c:\python37\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 489, in exec_module File "tensorflow\python\pywrap_tensorflow_internal.py", line 28, in File "tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_impor t_helper ImportError: DLL load failed: 找不到指定的模块。

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. [5916] Failed to execute script main

C:\Users\a>‘

Dimsmary commented 4 years ago

ossas打包了python和tensorflow环境,目前我对pyinstaller打包的机制还不太清楚,这似乎是调用了本地python环境导致的。 你可以clone本项目后,尝试在python3.7 tensorflow2.1.0的环境下运行main.py来观察是否仍有问题。