首先安装配置好CUDA和cuDNN,参考我之前的一篇笔记。
1、Pytorch下载
在Pytorch官网 根据对应版本选择下载:
复制command。
打开cmd,创建虚拟环境:
conda create -n Pytorch python==3.7
然后激活环境:
conda activate Pytorch
然后安装Pytorch,安装时间会有点久~
pip3 install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio===0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
检验是否安装成功:
输入 python ,import torch 即可