安装Pytorch0.4.0需要填的坑!!!

根据官网提供的旧版本的下载办法:
在这里插入图片描述

安装pytorch0.4.0:

sudo pip install torch==0.4.0 -f https://download.pytorch.org/whl/cu90/stable

但是呢,极其慢,然后还断了!!!别急,下面就给解决方案:

配置pip镜像源

由于pytorch的安装包有500M左右的大小,不设置镜像源可能因为网速问题而失败。

国内镜像源列表
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
这里采用ailiyun镜像,因为服务器是阿里云的,就都用一家吧

更新源

运行一下命令:

cd ~/.pip

如果不存在该文件夹则:

mkdir ~/.pip
cd ~/.pip
touch pip.conf
vim pip.conf

在pip.conf中添加一下内容:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

保存即可

再次安装成功

在这里插入图片描述

测试下

在这里插入图片描述
成功~

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值