【发布时间】: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 构建需要 CUDA 9.0。
Could not find 'cudart64_90.dll'如果您已按照问题标题中的说明安装了 CUDA 9.1,则无法替代。您必须使用 CUDA 9.0。 -
为什么需要 9.0?
-
@gm9089zo: 因为它是针对它编译的并且具有二进制依赖关系
标签: python tensorflow cuda windows-10 anaconda