解决NVIDIA Geforce RIX 3060 Laptop GPU与pytorch版本不兼容

问题描述:

在跑分类任务时间遇到以下错误:

​UserWarning:NVIDIA Geforce RIX 3060 Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch Instell supports CUDA capabilities sa_37 sm_50 sa_60 sm_61 se,70 sn_75 compute._37. If you want to use the NVIDIA Geforce RTX 3060 Laptop GU GPU with PyTorch, please check the instructions at http://pytorch.org/get-started/locally/ 

问题原因:

造成这一错误的原因是我的RTX3060的显卡和pytorch的版本不适配,pytorch的版本过低或者过高。

问题解决:

打开pycharm终端Termina激活pytorch虚拟环境,前面由base变成pytorch则激活成功。

键入conda list查看当前torch的版本如下:

可知当前python解释器的版本为3.8,torch的版本为1.10.0,cuda的版本为10.2,版本过低。

在重新安装前需要卸载低版本,在终端Termina键入:

pip uninstall torch
pip uninstall torchaudio
pip uninstall torchvision

卸载完成之后需要重新安装适配显卡的torch版本。

按win+r打开命令窗口键入:nvidia-smi

查看显卡最高支持的cuda版本,如下:

显卡所支持cuda的最高版本为11.7。 

需要注意的是版本之间的对应,其官网的对应关系如下链接。

进入官网:Previous PyTorch Versions | PyTorch

找到对应的CUDA版本,我对应下载CUDA11.6版本。

其中torch的版本为1.13.0,适配于python3.8的版本。 

pytorch版本1.13.0,cuda版本为11.6,键入一下命令重新安装适配版本:

pip install torch==1.13.0+cu116 torchvision==0.14.0+cu116 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu116

安装成功,问题解决。 

  • 7
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值