安装tensorflow

环境:虚拟机centos7(centos6.x会因为glibc版本出问题)

官方文档:https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html#using-conda

1.安装anaconda

2.使用anaconda安装tf

有两种方法

一是按照官方文档

source activate tensorflow
conda install -c conda-forge tensorflow
二是安装conda-forge:https://github.com/conda-forge/tensorflow-feedstock

conda config --add channels conda-forge
conda install tensorflow

然而这两种方法都遇到了不同的网络问题:requests.packages.urllib3.exceptions.ProtocolError: ("Connection broken: error(104, 'Connection reset by peer')", error(104, 'Connection reset by peer'))

Could not connect to https://conda.anaconda.org/conda-forge/linux-64/tensorflow-0.9.0-py27_0.tar.bz2
Error: Connection error: EOF occurred in violation of protocol (_ssl.c:590): https://conda.anaconda.org/conda-forge/linux-64/tensorflow-0.9.0-py27_0.tar.bz2

因而转而用pip安装

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl

(tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL
然而下载了安装包之后报错:

Found existing installation: setuptools 23.0.0
Cannot remove entries from nonexistent file /root/anaconda2/envs/tensorflow/lib/python2.7/site-packages/easy-install.pth

使用conda remove setuptools也不成功

最后将

pip install --ignore-installed --upgrade $TF_BINARY_URL
改为
pip install  $TF_BINARY_URL
问题解决

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值