繁体   English   中英

我安装了Tensorflow gpu版本以及CUDA 9.1和python 3.6.5。 但是,在导入tensorflow-gpu之后,出现以下错误:

[英]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:

追溯(最近一次通话):

  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

目前Tensorflow仅支持CUDA 9.0

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

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

  • 选项2:您安装CUDA 9.0,然后等待直到Tensorflow支持CUDA 9.1

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

另请参阅GitHub上的问题,以了解Tensorflow对CUDA 9.1的当前支持状态以及如何从源代码编译Tensorflow。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM