Tensorflow 2.0 .: ImportError:DLL加载失败:找不到指定的模块

时间:2019-06-02 22:55:02

标签: tensorflow

我刚刚使用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环境中的PC上成功安装了tensorflow-gpu 1.13。看来tensorflow 2.0与python 3.7 Ultimate Guide to TensorFlow 2.0 in Python兼容吗?

1 个答案:

答案 0 :(得分:1)

TF2.0是在考虑CUDA 10的情况下构建的。 source

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