pytorch安装

官方给的命令

conda install pytorch torchvision cuda100 -c pytorch

1⃣️源码安装

https://blog.csdn.net/weixin_40919942/article/details/80422718

2⃣️换源

conda config --prepend channels http://mirrors.ustc.edu.cn/anaconda/pkgs/free/

conda config --prepend channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --prepend channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --prepend channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

vi ~/.condarc查看修改

出现问题:

CondaError: CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/linux-64/cuda100-1.0-0.tar.bz2>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

安装命令改成

conda install pytorch torchvision cuda100(删去通道 -c pytorch)

即可

测试:

但是装完发现版本不匹配。。。

于是

参考了https://blog.csdn.net/Miya_coding/article/details/82666790

https://blog.csdn.net/sinat_33425327/article/details/84823272

http://www.pianshen.com/article/560640807/

pytorch0.4.1+CUDA8.0+win10+Anaconda安装

 

安装教程:

1,首先添加镜像:conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ 

2,下载离线包:https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64/

在里面选择:pytorch-0.4.1-py36_cuda80_cudnn7he774522_1.tar.bz2(其他的类似)

3,选择下载路径:cd 路径

4,在下载包的路径中打开命令行:conda install --offline (包的名字)

conda install --offline pytorch-0.4.1-py36_cuda80_cudnn7he774522_1.tar.bz2 

5,安装torchvision

pip install torchvision

 

测试CUDA是否安装好

# CUDA TEST

import torch

x = torch.Tensor([1.0])

xx = x.cuda()

print(xx)

# CUDNN TEST

from torch.backends import cudnn

print(cudnn.is_acceptable(xx))

--------------------- 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值