【问题标题】:Tensorflow-alpha-gpu issue ImportError: DLL load failed: The specified module could not be foundTensorflow-alpha-gpu 问题 ImportError: DLL load failed: 找不到指定的模块
【发布时间】:2019-03-30 17:17:53
【问题描述】:

我以前有 cuda9.0_0 和 cudnn7.1.4,我想在 gpu 中运行 tf-alpha,从这个 tf 指南:https://www.tensorflow.org/install/gpu 我发现我需要 cuDNN SDK (>= 7.4.1) 和 cuda10.so 我从控制面板卸载了以前的版本并安装了 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

【问题讨论】:

  • 我找到了解决办法,我在电脑上重新安装了anaconda,重新安装了CUDA并安装了10.0版本,一切正常!

标签: tensorflow anaconda cudnn tensorflow2.0


【解决方案1】:

注意:
TensorFlow 版本 >= 1.13 需要 CUDA 10.0,TensorFlow 版本
查看软件需求了解更多https://www.tensorflow.org/install/gpu#software_requirements

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

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-12-04
    • 1970-01-01
    • 2020-07-02
    • 2020-06-30
    • 2015-12-16
    • 2019-08-06
    • 1970-01-01
    相关资源
    最近更新 更多