1 清华镜像下载anaconda
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
vi .profile
export PATH=/home/wlzhang/anaconda3/bin:$PATH
重新打开终端
2 在conda下为pytorch创建一个虚拟环境。
conda create -n pytorch
创建指定python版本的环境
conda create -n pytorch python=3.6.2
tips: 删除环境
conda remove -n pytorch--all
3 配置清华源
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 --set show_channel_urls yes
pytorch源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
4 官网安装 https://pytorch.org/get-started/locally/
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch
安装指定版本的pytorch
conda install pytorch=0.4.1
查看pytorch版本
print(torch.__version__)
5 BasicSR相关依赖包
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy opencv-python lmdb tensorboardX
6 python的matlab接口配置
cd ~/software/matlab2017/extern/engines/python/
python setup.py install