关于3050等30、40系显卡不适配torch版本的解决方案:

运行代码后出现以下警告:

UserWarning: NVIDIA GeForce RTX 3050 Laptop GPU with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37. If you want to use the NVIDIA GeForce RTX 3050 Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

解决方案:

①进入环境   

conda activate 环境名称

②卸载当前版本

pip uninstall torch torchvision torchaudio -y

③安装适配sm_86的 PyTorch 版本:CUDA 11.8 版本

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

即可正常运行

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐