使用 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
被困在这个问题上有一段时间了,有什么想法吗?
尝试安装手电筒
必须重新安装 cuDNN: