安装Conda
-
wget下载 .sh文件
wget -c https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
-
安装
bash Miniconda3-latest-Linux-x86_64.sh
接着出现的内容 除了按回车 就是输入yes
-
激活
source ~/.bashrc
-
换源–可选
安装Pytorch
-
创建虚拟环境
conda create -n pytorch1.11 python=3.9
-n 后的是虚拟环境名称;我这里选择python版本为3.9
-
进入虚拟环境并安装Pytorch
conda activate pytorch1.11
到下面网址选取想要的pytorch版本,复制安装指令
https://pytorch.org/get-started/previous-versions/conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch
-
检查安装是否成功
conda list # 看是pytorch 和 cudatoolkit是否对得上
参考
[1] https://www.lxlinux.net/2523.html
[2] https://www.jianshu.com/p/2f5cf2edaaef