代码之家  ›  专栏  ›  技术社区  ›  Sai Krishnadas

importero:无法加载本机Tensorflow

  •  0
  • Sai Krishnadas  · 技术社区  · 7 年前

    操作系统:

    Python版本: 3.5条

    Cuda版本:

    Cudnn版本: 7.1款

    夸德罗4000

    pip install--忽略已安装--升级tensorflow gpu

    Tensorflow安装在我的一个水蟒环境中。

    但是,当我尝试导入Tensorflow或keras(它也是在同一conda环境中使用pip安装的)时,出现了一个错误:

    ImportError: Traceback (most recent call last):
      File "C:\Users\HP\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\HP\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\HP\Anaconda3\envs\tensorflow\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\HP\Anaconda3\envs\tensorflow\lib\imp.py", line 243, in load_module
        return load_dynamic(name, filename, file)
      File "C:\Users\HP\Anaconda3\envs\tensorflow\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.
    

    希望有人能帮助我。尝试了很多谷歌搜索,但无法解决。

    0 回复  |  直到 7 年前
        1
  •  1
  •   Matěj Račinský    7 年前

    这看起来好像您没有将CUDA和CUDNN库添加到路径(基于它缺少DLL的事实),而是将它们添加到路径,以便Tensorflow可以找到它们。

    或者可能是因为CUDA和CUDNN的版本不正确,Tensorflow对两者的版本都很挑剔,所以请检查CUDA和CUDNN版本是否与Tensorflow版本兼容。

    推荐文章