![](/img/trans.png)
[英]ImportError: No module named '_pywrap_tensorflow_internal'
[英]ImportError: No module named '_pywrap_tensorflow_internal' at python 3.5
當我嘗試在Windows10上導入tensorflow時出現此錯誤,python 3.5版是cpu版本,並且我有MSVCP140.DLL。
我在SO上發現了很多問題,所以我將python降級到3.5版,然后安裝了MSVCP140.DLL。...出了什么問題?
Traceback (most recent call last):
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "E:\tensorflow_study\tensorflow\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "E:\tensorflow_study\tensorflow\lib\imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "E:\tensorflow_study\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
import _pywrap_tensorflow_internal
ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
編輯:我用這個表彰
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.6.0-py3-none-any.whl
安裝tensorflow。 這是這個錯誤嗎?
這與CPU或GPU沒有直接關系。 時不時地在tesla GPU和Mac的CPU中都遇到此錯誤。 最近,我在osx上使用了1.13版本,但我嘗試過的所有內容都沒有寫在github上,或者在我更新到新的beta版本之前,這里沒有起作用。 請注意,導入庫時必須將“ keras”更改為“ tensorflow.keras”。
pip install tensorflow==2.0.0-beta0
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.