win10在Anaconda上安装Pytorch

35 篇文章 6 订阅
31 篇文章 3 订阅
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64/
conda config --add channels https://anaconda.org
conda config --set show_channel_urls yes
丢个链接:https://pytorch.org/
import torch
import torchvision
print(torch.__version__)
print(torchvision.__version__)
print( torch.cuda.is_available() ) # True: 可以,False: 不可以

完成!!!!!!!!

创建Pytorch虚拟环境

conda create --name pytorch python=3.8

然后进入pytorch虚拟环境:

activate pytorch

安装pytorch

输入上述官网提供的安装命令:

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

安装报错,pytorch包无法下载安装:

 
  1. CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/win-64/pytorch-1.0.1-py3.6_cuda90_cudnn7_1.tar.bz2>

  2. Elapsed: -

  3. An HTTP error occurred when trying to retrieve this URL.

  4. HTTP errors are often intermittent, and a simple retry will get you on your way.

然后执行pytorch的安装命令:

conda install pytorch torchvision cudatoolkit=10.1

结果终于成功!!!!!!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值