gpt4 book ai didi

python - Tensorflow 导入错误

转载 作者:太空狗 更新时间:2023-10-29 20:19:37 24 4
gpt4 key购买 nike

我正在尝试安装支持 GPU 的 tensorflow。

我尝试了以下链接中的信息

https://www.tensorflow.org/install/install_windows

  1. CUDA® 工具包 8.0
  2. cuDNN v6.0
  3. 具有 CUDA Compute Capability 3.0 的 GPU 卡 - GeForce 940MX

然后使用pip3 install --upgrade tensorflow-gpu安装tensorflow。

但是我在尝试导入 tensorflow 时遇到以下错误。

    Traceback (most recent call last):
File "C:\Research\Python_installation\lib\site-packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File "C:\Research\Python_installation\lib\ctypes\__init__.py", line 347, 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#6>", line 1, in <module>
import tensorflow as tf
File "C:\Research\Python_installation\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Research\Python_installation\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Research\Python_installation\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Research\Python_installation\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

有人可以建议我如何使用它吗。

最佳答案

我有一个类似的问题,必须非常小心 CUDA 的版本和 CuDNN 的版本。我遇到了您遇到的确切错误,并通过我在此处记录的内容修复了它:http://www.laurencemoroney.com/installing-tensorflow-with-gpu-on-windows-10/

试试吧! :)

(我发现最常见的失败是您下载了最新 CUDA,而不是匹配 CUDA。现在 CUDA 是 9.1,但 TF 需要9.0 -- 你的错误是 cudart90.dll) -- 所以找到 9.0 驱动程序,下载并安装它们。然后运行 ​​TensorFlow。它可能会在 CuDNN 驱动程序上失败,这很好,因为您知道 CUDA 是正确的。然后下载正确的 CuDNN 驱动程序(与错误中的版本号匹配)并重试。)

关于python - Tensorflow 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48477909/

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