pytorch快速安装方法

本文介绍了如何创建conda虚拟环境并设置为默认,同时修改conda镜像源以加速下载。通过清华大学开源软件镜像站,提高了conda安装PyTorch 1.6.0和torchvision 0.7.0的效率。
摘要由CSDN通过智能技术生成

 

1.创建conda虚拟环境conda create -n pt python=3.6

2.设置开启的默认虚拟环境

    2.1  sudo gedit ~/.bashrc

   2.2  source ~/.bashrc

3.修改conda的镜像

  3.1  sudo gedit /.condarc

 

channels:

  - 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

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

  - defaults

show_channel_urls: true

channel_priority: flexible

 

4  安装pytorch

  conda install pytorch==1.6.0 torchvision==0.7.0   (不要加 -c pytorch)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值