0
當我嘗試import tensorflow
我得到以下錯誤:Tensorflow-GPU:導入錯誤:沒有模塊名爲_pywrap_tensorflow
>>import tensorflow
File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 66, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in <module>
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\...\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow')
File "C:\Users\...\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named _pywrap_tensorflow
Failed to load the native TensorFlow runtime.
See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
我安裝了msvcp140.dll Redistributable
推薦here,但它並沒有幫助。有任何想法嗎?我正在運行Anaconda3
環境。
根據https://github.com/tensorflow/tensorflow/issues/7529,可能是cuDNN沒有正確安裝。你確定它在你的PATH變量中嗎? –
是的,它是有 –
[在Windows上,運行「導入tensorflow」生成沒有模塊命名爲「\ _pywrap \ _tensorflow」錯誤](https://stackoverflow.com/questions/42011070/on-windows-running-import -tensorflow-generated-no-module-named-pywrap-tenso) – user1735003