gpt4 book ai didi

python - "import tensorflow as tf"导入错误 : Could not find 'cudart64_90.dll'

转载 作者:行者123 更新时间:2023-11-28 22:20:44 24 4
gpt4 key购买 nike

我正在尝试学习 Python,特别是 TensorFlow。到目前为止,我已按照说明进行操作并克服了几个问题,并成功安装了 TensorFlow(pip 安装)、CUDA(9.1.85 win10)、Python(3.6.3 amd64)和 CUDNN(8.0 win10x64),因为我有一个 GPU( GTX 1080) 并希望能够用它来训练网络。我的电脑有一个英特尔 i7 和 Windows 10。我从 CUDA(8.0.61 win10) 开始,但它导致了一个错误,说它需要版本 9。

当我尝试用

进行测试时
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))

我在第一行收到这个错误

>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File "C:\Program Files\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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import tensorflow as tf
File "C:\Program Files\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Program Files\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

我该如何解决这个问题?

PS:我已经阅读了本网站上有关此问题的所有其他问题,并且还阅读了 common problems页。抱歉,这些错误似乎与我的具体问题不符,但显然我在这里迷路了。

最佳答案

Tensorflow 目前不支持 CUDA 9.1 请参阅(可能很快会更改):https://github.com/tensorflow/tensorflow/issues/15656

您可以从此 URL 下载并安装 CUDA 9.0:https://developer.nvidia.com/cuda-toolkit

关于python - "import tensorflow as tf"导入错误 : Could not find 'cudart64_90.dll' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48737869/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com