torch.cuda.is_available() returns 错误为什么?

torch.cuda.is_available() returns False why?

有人遇到过吗?

I tried updating drivers and reinstalling cuda

Cuda 版本:11.4

GPU:GeForce RTX 3060 Laptop(6gb)

OS: Windows 10 home

torch.版本: 1.9.0+cpu

您正在使用为 CPU 编译的 PyTorch 版本,您应该安装适当的版本:

  • 使用conda:

    conda install pytorch torchvision cudatoolkit=11.1 -c pytorch -c conda-forge 
    
  • 使用pip:

    python -m pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html