实验室服务器安装
1、安装anaconda
2、conda创建虚拟环境
conda install和创建虚拟环境下载慢
亲测最好用
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
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/cloud/msys2/
conda config --set show_channel_urls yes
- 创建环境
conda create -n 环境名 python=3.7
- 激活环境
source activate 环境名
- 安装依赖
pip install -r requirements.txt
- 退出环境
source deactivate
- 删除环境
conda remove -n 环境名 --all
- 删除环境内某个包
conda remove --name 环境名 包名
3、安装pytorch
# CUDA 10.0
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
验证
python
import torch
python 3.6.11
conda install pytorch==0.4.0 torchvision==0.2.1 cuda100 -c pytorch