断言错误:尝试在 conda 中使用 Torch 时,Torch 未在启用 CUDA 的情况下编译

问题描述 投票:0回答:1

使用 https://pytorch.org/get-started/locally/#anaconda

>> python
>> conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
...
Python 3.8.18 (default, Sep 11 2023, 13:39:12) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
> import torch
> >>> import torch
> >>>
> >>> if torch.cuda.is_available():
> ...     print("CUDA is available.")
> ... else:
> ...     print("CUDA is not available.")
> ...
> CUDA is not available.

GTX 4020,Windows,更新驱动程序。

AssertionError: Torch not compiled with CUDA enabled

被困在这个问题上有一段时间了,有什么想法吗?

尝试安装手电筒

pytorch conda
1个回答
0
投票

必须重新安装 cuDNN:

© www.soinside.com 2019 - 2024. All rights reserved.