Anaconda虚拟环境利用conda创建cuda,cudnn虚拟环境

Anaconda虚拟环境利用conda创建cuda,cudnn虚拟环境

参考链接:
https://blog.youkuaiyun.com/qs17809259715/article/details/103729478
anaconda建立虚拟环境及conda操作
创建虚拟环境

conda create -n python_cuda101 python=3.7

开启虚拟环境:

conda activate python_cuda101

为了使用conda安装迅速,使用清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/
参考链接:https://blog.youkuaiyun.com/watermelon1123/article/details/88122020
配置源:

sudo gedit ~/.condarc

配置文件修改为:

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
show_channel_urls: true

torch官网下载链接:https://pytorch.org/get-started/locally/
命令行安装(注意一定去掉-c):

阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
更新国内源

pip install tensorflow_gpu==1.12.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
 conda install pytorch torchvision cudatoolkit=10.1

将nlp复制成tf2

conda create -n tf2 --clone nlp

删除原环境

conda remove -n nlp --all
anaconda search -t conda tensorflow
anaconda show nehaljwani/tensorflow
anaconda show anaconda/tensorflow-gpu
anaconda show cjj3779/tensorflow-gpu
conda install --channel https://conda.anaconda.org/nehaljwani tensorflow

anaconda search -t conda tensorflow-gpu

#列出所有的虚拟环境

conda env list
conda list --name [虚拟环境名]
conda create --name pythonkid python=3.6.5

激活虚拟环境

source activate pythonkid
conda activate pythonkid

取消激活虚拟环境

source deactivate pythonkid

虚拟环境激活后,在cmd中输入python,显示的就是一个新的环境。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值