gpt4 book ai didi

python - TensorFlow 1.3 GPU 版本不适用于 Windows 7

转载 作者:太空宇宙 更新时间:2023-11-04 09:56:12 25 4
gpt4 key购买 nike

我是机器学习的初学者,正在尝试使用 Anaconda 设置 TensorFlow python 环境。但是,我一直在处理“没有名为“pywrap_tensorflow_internal”的模块”的常见问题

>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 126, in im
port_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 985, in _gcd_import
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 938, in create_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow_internal.py", line 21, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "C:\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 126, in im
port_module
return _bootstrap._gcd_import(name[level:], package, level)
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 "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\__init__.py",
line 24, in <module>
from tensorflow.python import *
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init_
_.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 126, in im
port_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 985, in _gcd_import
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
File "<frozen importlib._bootstrap>", line 577, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 938, in create_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow_internal.py", line 21, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_
tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "C:\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 126, in im
port_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

尽管这是与许多其他问题相同的错误,但似乎没有任何解决方案有效。我在我的 %PATH% 中安装并指向了 MSVCP140.DLL,我在 Python 3.5 上运行它。我认为问题出在 CUDA 中,因为当我运行 TensorFlow 的 CPU 版本时不会出现此问题

但是,我很难弄清楚我的 CUDA 设置有什么问题。我安装了 CUDA 8 和 cuDNN v5.1。 Here is what my CUDA install folder looks like. cuDNN is just the files extracted from the cuDNN zip.

此外,这里是我的%PATH%的相关部分:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cudaNN\bin\cudnn64_5.dll;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cudaNN\include\cudnn.h;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\cudaNN\lib\x64\cudnn.lib;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\lib;
C:\Windows\System32\msvcp140.dll;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\CUPTI\libx64;
C:\Windows\SysWOW64\msvcp140.dll;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;

我完全不知道我的设置有什么问题,所以非常感谢任何帮助。

最佳答案

如果你安装了GPU版本的TensorFlow 1.3(昨天发布),发布的PIP包需要cuDNN 6。您可以从 NVIDIA's website 安装它.确保包含文件 cudnn64_6.dll 的目录包含在您的 %PATH% 环境变量中。

关于python - TensorFlow 1.3 GPU 版本不适用于 Windows 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45748009/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com