【问题标题】:Tensorflow Installation with CUDA 9.1 and Python 3.6 on Windows 10 [duplicate]在 Windows 10 上使用 CUDA 9.1 和 Python 3.6 安装 Tensorflow [重复]
【发布时间】:2018-03-13 11:41:07
【问题描述】:

我在安装 TensorFlow 时遇到了这个错误。编辑:我安装了 CUDA 9.0,并更改了我的环境变量,包括 Path 变量,现在它可以工作了。

    (tensorflow-gpu) C:\Users\Admin>python
Python 3.6.4 |Anaconda, Inc.| (default, Mar  9 2018, 07:43:39) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\conda\conda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
    ctypes.WinDLL(build_info.cudart_dll_name)
  File "C:\Users\Admin\AppData\Local\conda\conda\envs\tensorflow-gpu\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Admin\AppData\Local\conda\conda\envs\tensorflow-gpu\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\Admin\AppData\Local\conda\conda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Admin\AppData\Local\conda\conda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
    self_check.preload_check()
  File "C:\Users\Admin\AppData\Local\conda\conda\envs\tensorflow-gpu\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 installation with CUDA 9.1 and python 3.6

【问题讨论】:

  • 您的 tensorflow 构建需要 CUDA 9.0。 Could not find 'cudart64_90.dll' 如果您已按照问题标题中的说明安装了 CUDA 9.1,则无法替代。您必须使用 CUDA 9.0。
  • 为什么需要 9.0?
  • @gm9089zo: 因为它是针对它编译的并且具有二进制依赖关系

标签: python tensorflow cuda windows-10 anaconda


【解决方案1】:

这类似于Tensorflow import error

快速回答:默认情况下,NVidia 将安装最新版本的 CUDA,现在是 9.1

TensorFlow 期待 9.0,如“ImportError: Could not find 'cudart64_90.dll'”中所示——阅读为 cuda-runtime-64-bit-version9.0 DLL

要解决此问题,请前往 NVidia 网站下载 9.0 版本的驱动程序,一切顺利。我在这里写了一个指南:http://www.laurencemoroney.com/installing-tensorflow-with-gpu-on-windows-10/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-17
    • 2019-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-19
    相关资源
    最近更新 更多