【问题标题】:Tensorflow 2.0.: ImportError: DLL load failed: The specified module could not be foundTensorflow 2.0.: ImportError: DLL load failed: 找不到指定的模块
【发布时间】:2019-06-03 07:16:11
【问题描述】:

我刚刚使用 pip 命令安装了 tensorflow 2.0:

pip install tensorflow-gpu==2.0.0-alpha0

导入错误如下图:

import tensorflow as tf
Traceback (most recent call last):

  File "<ipython-input-1-64156d691fe5>", line 1, in <module>
    import tensorflow as tf

  File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\__init__.py", line 27, in <module>
    from tensorflow._api.v2 import audio

  File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\_api\v2\audio\__init__.py", line 8, in <module>
    from tensorflow.python.ops.gen_audio_ops import decode_wav

  File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow

  File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)

ImportError: Traceback (most recent call last):
  File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Anaconda\Anaconda3.7\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Anaconda\Anaconda3.7\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:\Anaconda\Anaconda3.7\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Anaconda\Anaconda3.7\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.


Failed to load the native TensorFlow runtime.

安装是在 Windows 10 上使用 python 3.7.1 和 cuda 9.0 完成的。 我已经在 python 3.5 环境中的电脑上成功安装了 tensorflow-gpu 1.13。看来 tensorflow 2.0 兼容 python 3.7 Ultimate Guide to TensorFlow 2.0 in Python

【问题讨论】:

    标签: tensorflow


    【解决方案1】:

    TF2.0 在构建时考虑了 CUDA 10。 source

    您可以使用 cuDNN SDK (>= 7.4.1) 安装 CUDA 10.0,也可以从源代码构建 Tensorflow。

    【讨论】:

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