1、我的显卡是RTX 3090,安装了CUDA 11.1,以及Pytorch 1.8/1.9,一直报错!!!
但是在理论上,不应该出现这个问题的,因为这些版本都是在兼容范围内的!
这个问题困扰了我一晚上,一直测试了不同版本的pytorch,弄到半夜都没有解决,最后才发现并不是理论上的问题!
因为,按照pytorch官网上说的,需要两者一起装,即cuda11.1+pytorch1.8/1.9,如果分开装就会报错,猜测原因可能两者之间的某些依赖有问题,但不管它了,只要能用就行,这个bug相信官方后面会解决的!
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
或者高一个版本:
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
安装11.1的cuda及对应pytorch即可解决问题
完成后conda list查看pytorch等版本:
2、我的显卡是RTX 3090,安装了CUDA 11.3,以及Pytorch 1.12 !!!
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
3、显卡3090, 安装了CUDA12.3,安装pytorch!!!