首先确保安装了anaconda,在anaconda prompt命令行窗口创建虚拟环境。
conda create -n pytorch python==版本
激活:
conda activate pytorch==版本
设置清华源,加速安装:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
开始指定版本安装:
pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 -f https://download.pytorch.org/whl/torch_stable.html
输入conda list检查一下
参考链接:https://blog.csdn.net/cyy0789/article/details/131137525