Tensorflow-alpha-gpu问题ImportError:DLL加载失败:找不到指定的模块

时间:2019-03-30 17:17:54

标签: tensorflow anaconda cudnn tensorflow2.0

我以前有cuda9.0_0和cudnn7.1.4,我想在gpu中运行tf-alpha,来自此tf指南:https://www.tensorflow.org/install/gpu我发现我需要cuDNN SDK(> = 7.4.1)和cuda10。所以我从控制面板上卸载了以前的版本,并安装了Cuda编译工具,版本10.1,V10.1.105。因此,我应该成功导入tf,但是没有,我得到了错误。 如果我有

    conda list cudnn

我知道了

    # packages in environment at F:\Anaconda:
    #
    # Name                    Version                   Build  Channel
    cudnn                     7.1.4                 cuda9.0_0    anaconda

尽管我安装了cuda 10并通过运行成功验证了cudnn

    nvcc --version

我安装了anaconda并使用了以前的cuda,而我之前使用的是tf 1.12.0 gpu,而我的gpu是nvidia 1050ti

    import tensorflow as tf

我希望它会导入tensorflow 2.0 alpha gpu版本

我得到的错误:

Traceback (most recent call last):
File "F:\Anaconda\lib\site-packages\tensorflow\python       
\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "F:\Anaconda\lib\site-packages\tensorflow\python  
\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "F:\Anaconda\lib\site-packages\tensorflow\python          
\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname,  
description)
File "F:\Anaconda\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "F:\Anaconda\lib\imp.py", line 343, in load_dynamic
return _load(spec)
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 "<stdin>", line 1, in <module>
File "F:\Anaconda\lib\site-packages\tensorflow\__init__.py", line 27, in        
<module>
from tensorflow._api.v2 import audio
File "F:\Anaconda\lib\site-packages\tensorflow\_api\v2\audio                    
\__init__.py", line 8, in <module>
from tensorflow.python.ops.gen_audio_ops import decode_wav
File "F:\Anaconda\lib\site-packages\tensorflow\python\__init__.py", line   
49, in <module>
from tensorflow.python import pywrap_tensorflow
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "F:\Anaconda\lib\site-packages\tensorflow\python
\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname,   
description)
File "F:\Anaconda\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "F:\Anaconda\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.


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.

我的python版本是3.6.6

1 个答案:

答案 0 :(得分:2)

注意:
TensorFlow版本> = 1.13需要CUDA 10.0,而TensorFlow版本<1.13(直到TF 1.5)需要CUDA 9.0。
请参阅软件要求以了解更多https://www.tensorflow.org/install/gpu#software_requirements

还需要NVIDIA®GPU卡和CUDA®Compute Capability 3.5或更高版本
请参阅硬件要求以了解更多信息
https://www.tensorflow.org/install/gpu#hardware_requirements

希望这会有所帮助。