【问题标题】:I installed the Tensorflow gpu version and CUDA 9.1 and python 3.6.5. However, after I import the tensorflow-gpu I got the following error:我安装了 Tensorflow gpu 版本和 CUDA 9.1 和 python 3.6.5。但是,在我导入 tensorflow-gpu 后,出现以下错误:
【发布时间】:2018-10-27 00:12:19
【问题描述】:

Traceback(最近一次调用最后一次):

  File "C:\Users\ranji\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
    ctypes.WinDLL(build_info.cudart_dll_name)
  File "C:\Users\ranji\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

在处理上述异常的过程中,又发生了一个异常:

Traceback (most recent call last):
  File "C:/Users/ranji/AppData/Local/Programs/Python/Python36/ts1.py", line 1, in <module>
    import tensorflow as tf
  File "C:\Users\ranji\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\ranji\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\ranji\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
    self_check.preload_check()
  File "C:\Users\ranji\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
    % (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit

【问题讨论】:

    标签: python windows tensorflow


    【解决方案1】:

    目前 Tensorflow 只支持 CUDA 9.0

    但是您已经安装了 CUDA 9.1。您现在有两个选择:

    • 选项 1:从源代码编译 Tensorflow,然后启用对 CUDA 9.1 版的支持

    • 选项 2:您安装 CUDA 9.0 并等待 Tensorflow 支持 CUDA 9.1

    我经历了同样的痛苦并决定安装 CUDA 9.0。这可能不那么麻烦。

    有关 CUDA 9.1 的 Tensorflow 支持的当前状态以及如何从源代码编译 Tensorflow,另请参阅此 issue on GitHub

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-10
      • 2021-04-28
      • 2017-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-04
      相关资源
      最近更新 更多