- 安装anaconda发行版中所有的包
conda install anaconda
- 查看当前虚拟环境cuda cudnn版本 conda list 并查看
cat /usr/local/cuda-9.0/version.txt
cat /usr/local/cuda-9.0/include/cudnn.h | grep CUDNN_MAJOR -A 2
- 更换清华源
不同的安装包存在的位置可能不一样,例如cuda不同版本的安装包分别在free和main里面
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/
- 安装指定版本的tensorflow
conda install --channel https://conda.anaconda.org/anaconda tensorflow-gpu=1.5.0
或者
pip3 install tensorflow-gpu==1.5 -i https://pypi.tuna.tsinghua.edu.cn/simple
- 移除虚拟环境
conda env remove -n python35
- 安装opencv
conda install --channel https://conda.anaconda.org/menpo opencv3
- pip使用国内源
加上
-i https://pypi.tuna.tsinghua.edu.cn/simple
例如安装
例如:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider
这样就会从清华这边的镜像去安装pyspider库。
安装8.0版本的cuda
- 安装固定版本的cuda cudnn
conda install cudatoolkit=8.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
conda install cudnn=7.0.5 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
9.0版本以上的cuda 可以查看清华源中有没有cuda的对应版本
conda install cudatoolkit=9.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
conda install cudnn=7.1.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
- pytorch torchvision指定版本
conda install pytorch=0.3.0 torchvision=0.2.0 -c soumith