pip install 和 conda install 使用国内镜像源

pip

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple *****

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/pkgs/main/
conda config --set show_channel_urls yes

删除添加的源,恢复官方源

conda config --remove-key channels

查看源的优先权,

$ conda config --get channels
##下面的是输出
--add channels 'defaults'   # lowest priority
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
--add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/'   # highest priority

tensorflow1.7

tensorflow在2.0之前的GPU版本和CPU版本是分开的,tensorflow在2.0后的版本不用区分GPU和CPU版本。

conda create -n tf17 python==3.6.10
source activate tf17
conda install cudatoolkit==9.0
conda install cudnn==7.0
pip install tensorflow-gpu==1.7.0
pip install keras==2.1.6

tensorflow1.14

conda create -n tf114 python==3.6.10
source activate tf114
conda install cudatoolkit==10.0.130
conda install cudnn==7.4.1
pip install tensorflow-gpu==1.14.0
pip install keras==2.2.5

tensorflow2.2

conda create -n tf22 python==3.7.10
source activate tf22
conda install cudatoolkit==10.1
conda install cudnn==7.6
pip install tensorflow==2.2.0
pip install keras==2.4.3

tensorflow2.4

conda create -n tf24 python==3.7.10
source activate tf24
conda install cudatoolkit==11.0
conda install cudnn==8.0
pip install tensorflow==2.4.1
pip install keras==2.4.3

利用上述命令,理论上可以安装好对应的tensorflow-gpu版本。

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值