ubuntu---解决pip安装tf很慢的问题

                                                                                                      ubuntu---解决pip安装tf很慢的问题

【问题】

执行
u@u160406:~$ sudo pip3 install tensorflow-gpu==1.15.0rc2
下载速度真的很慢
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting tensorflow-gpu==1.15.0rc2
  Downloading http://mirrors.aliyun.com/pypi/packages/8f/53/1ce32e04e6e44c008c6731d3a8bf706c534915adf31c35cdfcb1a64aebc0/tensorflow_gpu-1.15.0rc2-cp35-cp35m-manylinux2010_x86_64.whl (411.5MB)
     |███████                 | 411.5MB 11.9kb/s 


【解决】

将pip服务器更换为国内的镜像服务器
修改 ~/.pip/pip.conf (没有就创建一个):

# 如果不存在此文件夹,则创建之
mkdir ~/.pip
vi ~/.pip/pip.conf

内容如下:
[global]
index-url=http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com 

@ https://blog.csdn.net/davidhopper/article/details/81206673


【验证】

u@u160406:~$ sudo pip3 install tensorflow-gpu==1.15.0rc2
很快,目测1分钟不到
packages (from tensorboard<1.16.0,>=1.15.0->tensorflow-gpu==1.15.0rc2) (3.1.1)
Installing collected packages: tensorflow-gpu
Successfully installed tensorflow-gpu-1.15.0rc2
u@u160406:~$ 

 

posted on 2019-10-12 09:25  WP的烂笔头  阅读(990)  评论(0编辑  收藏  举报