我遇到以下错误:
Traceback (most recent call last): File
"C:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\self_check.py",
line 87, in preload_check
ctypes.WinDLL(build_info.cudnn_dll_name) File "C:\Anaconda\envs\tensorflow\lib\ctypes\__init__.py", line 348, in
__init__
self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "<stdin ", line 1, in
<module File
"C:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\__init__.py",
line 22, in <module
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File
"C:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py",
line 49, in <module
from tensorflow.python import pywrap_tensorflow File "C:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 30, in <module
self_check.preload_check() File "C:\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\self_check.py",
line 97, in preload_check
% (build_info.cudnn_dll_name, build_info.cudnn_version_number)) ImportError: Could not find 'cudnn64_7.dll'. TensorFlow requires that
this DLL be installed in a directory that is named in your %PATH%
environment variable. Note that installing cuDNN is a separate step
from installing CUDA, and this DLL is often found in a different
directory from the CUDA DLLs. You may install the necessary DLL by
downloading cuDNN 7 from this URL: https://developer.nvidia.com/cudnn
我已经在%Path%环境中提到的目录中安装了所需的“ cuDNN 7”文件,但是该语句
import tensorflow as tf
不管用。我已经从上述站点下载了cuDNN 7文件:
https://developer.nvidia.com/cudnn
我已经遍历了StackOverflow上的所有答案,但是却遇到了相同的错误。
请指导我如何运行以上声明。
最佳答案
您是否已导出PATH?有时,我们没有注意到这些小细节。
关于python - ImportError:找不到“cudnn64_7.dll”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51824219/