conda更换镜像源

解决win10下用conda安装PyTorch太慢的问题

此教程安装的是tensorflow2.3;

安装tensorflow-gpu==1.13.1或其他版本,与下述步骤相同,不同点:

conda install cudatoolkit=10.0.130

conda install cudnn=7.6

pip install tensorflow-gpu==1.13.1 -i https:…pypi.tuan.tsinghua.edu.cn/simple

  1. 进入

img

conda设置清华源【此为安装pytorch的国内镜像源】

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r

conda config --set show_channel_urls yes

查看已添加的conda镜像源

conda config --show

img

  1. 使用conda创建虚拟环境

conda create -n name python=x.x (name为设置的环境变量名)

进入conda虚拟环境:conda activate name

img

安装cuda

conda install cudatoolkit=10.1

安装tensorflow-gpu==1.13.1版本时:

conda install cudatoolkit=10.0.130或10.0

img

img

安装cudnn

img img

pip install tensorflow-gpu==2.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

Or

pip install tensorflow-gpu==2.3.0 -i https://pypi.douban.com/simple

安装tensorflow-gpu==1.13.1版本时:

pip install tensorflow-gpu==1.13.1 -i https:…pypi.tuan.tsinghua.edu.cn/simple

img

安装成功

img

测试验证tensorflow-gpu是否安装成功

Python

(tf23_py37) C:\Users\4102>python

Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Type “help”, “copyright”, “credits” or “license” for more information.

>>> import tensorflow as tf

2020-09-01 12:13:54.143035: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll

>>> tf.version

‘2.3.0’

>>>

img

至此,tensorflow-gpu安装成功。

注:安装其他第三方库:

pip install numpy(==2.3.0) -i https://pypi.tuna.tsinghua.edu.cn/simple

Or

pip install openslide(==1.1.0) -i https://pypi.douban.com/simple

卸载 img

参考:解决win10下用conda安装PyTorch太慢的问题https://www.it610.com/article/1278355336264171520.htm

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值