一、下载与安装Anaconda
官网:https://www.anaconda.com/download
安装时添加环境变量勾选上,这样可以减少一步操作,不用再去自己手动添加了。
二、在anaconda里面创建虚拟环境
创建虚拟环境,其中pytorch为虚拟环境名,3.8.8对应python版本号:
conda create -n pytorch python=3.8.8
激活进入虚拟环境,其中pytorch为虚拟环境名:
activate pytorch
三、查看自己CUDA版本
CMD命令行输入:nvidia-smi

四、有些电脑是自己带CUDA就不需要再安装
五、安装pytorch
pytorch命令获取网页:https://pytorch.org/get-started/previous-versions/

参考链接:https://blog.csdn.net/weixin_58283091/article/details/127841182