conda常用命令整理

  • 安装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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值