自己记录一下
https://download.pytorch.org/whl/torch_stable.html
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/d3bff3fd48154ced9f536eae9c48013a.pn
找到前面是cu+cuda版本的才是gpu,cpu开头的是下载cpu版的。我使用cuda11.5,这里可以看到torch使用1.11.0。
所以在anaconda里面输:

pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html
# torch==1.11.0(和上面需要下载的版本对应)+cu115(表明需要下载的是对应cuda版本11.5的gpu版的) 
# torchvision==0.12.0+cu115(和上面同理) 
# -f https://download.pytorch.org/whl/torch_stable.html (每次都加上)

个人常用:

pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html
pip install torch==1.10.0+cu113 torchvision==0.11.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
#链接上面的cu113可以加可以不加

更多推荐