为了跑代码,租了轻量级的服务器。
然后安装anaconda
bash Anaconda3-5.3.1-Linux-x86_64.sh -u
一直enter,yes就可
source /root/.bashrc
然后输入python
若调用的是python3,则跳过下面一步
若调用的依旧为python2
创建pytorch环境
激活
输入
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
然后安装
conda install pytorch-cpu=0.3.1
conda install torchvision-cpu
参考:https://blog.csdn.net/Cinderella___/article/details/88097679