【问题标题】:tensorflow-gpu in win10: ImportError: DLL load failedwin10中的tensorflow-gpu:ImportError:DLL加载失败
【发布时间】:2019-07-14 22:47:22
【问题描述】:

在win10(64位)安装tensorflow-gpu时出现问题,是我的配置:

  • Python 3.6.8(64 位)
  • Tensorflow 1.12(pip3 install --upgrade tensorflow-gpu)
  • CUDA 9.1 (cuda_9.1.85_win10.exe)
  • cudNN 7 (cudnn-9.1-windows10-x64-v7)
  • GTX 965M

我还设置了环境变量:

CUDA_PATH

Path

我复制了 NVDIA Toolkit 文件夹中的 cudNN 文件:

Copied files:

我的笔记本电脑中有 Microsoft Visual C++ 2015 Redistributalbe

我的错误和这个类似:Failed to load the native TensorFlow runtime on Win 10 64

这是我的错误:

    import tensorflow
Traceback (most recent call last):
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\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 "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: No se puede encontrar el módulo especificado.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\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 "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Josema\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: No se puede encontrar el módulo especificado.


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.x tensorflow windows-10 cudnn


    【解决方案1】:

    这些事情的发生是由于没有满足 tensorflow 所需的所有依赖项。不使用 pip,而是使用 anaconda 安装 tensorflow

    【讨论】:

    • 你是对的!我认为原因是我想安装它的那天我的互联网很慢,所以一些依赖项没有安装好。我所做的我创建了一个虚拟环境,它运行良好。感谢您的回复
    • 我不会使用 conda 来安装 tensorflow,因为它会安装许多您可能不需要的其他东西。您是否尝试过将 tensorflow 降级到例如 1.14.0 版本?它对我有用。
    猜你喜欢
    • 1970-01-01
    • 2018-12-29
    • 2022-12-30
    • 2020-06-02
    • 2018-08-13
    • 2018-10-25
    • 2021-04-28
    • 2020-11-19
    • 1970-01-01
    相关资源
    最近更新 更多