安装新Python环境model.to(device)运行缓慢解决

运行程序提示信息

NVIDIA GeForce RTX 3090 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 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

问题定位过程
1、搜索错误问题,感觉是pytorch版本和cuda版本问题
2、输出pytorch版本以及cuda版本信息:

#输出cuda版本信息
nvcc-version

#输出pytorch版本信息
python
import torch
torch.__version__

最后解决方法:按照错误提示给的网址
在里面选择对应cuda的pytorch下载方式
别忘记先把之前的pytorch卸载掉
conda uninstall pytorch

-----------------------------------新-----------------------------------
需要安装的pytorch为conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia

查询pytorch和GPU对应版本的网址:https://pytorch.org/get-started/locally/

torch和torchvision的对应关系
https://blog.csdn.net/xcls2010/article/details/125553626

今天在本地win10配置深度学习环境的时候遇到想在集成显卡上安装GPU上的pytorch但是发现
在这里插入图片描述
没有教程上说的NVIDIA 所以一直按照应该有的思路找如何显示的解决方案
但是遇到问题的时候(或者说遇到和预期不一致的时候)应该先想 这个不一致是否合理,回过头想一想自己之前的思路是否需要修正,而不是一条路走到黑。是应该努力解决问题,但也要有思考的解决问题,或者说规避问题。解决问题不是重点,达到目的是重点。

猜你喜欢

转载自blog.csdn.net/m0_45290027/article/details/127257499