前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >TensorFlow学习笔记:1、TensorFlow快速下载与安装

TensorFlow学习笔记:1、TensorFlow快速下载与安装

作者头像
程裕强
发布2018-01-02 16:43:07
1.1K0
发布2018-01-02 16:43:07
举报
文章被收录于专栏:大数据学习笔记

TensorFlow学习笔记:1、TensorFlow快速下载与安装

1.1 安装python-pip

代码语言:javascript
复制
[root@node1 ~]# yum install -y python-pip

1.2 安装TensorFlow

直接执行命令pip install tensorflow即可安装TensorFlow。

代码语言:javascript
复制
[root@node1 ~]# pip install tensorflow
Collecting tensorflow
  Downloading tensorflow-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl (43.1MB)
    0% |                                | 102kB 12kB/s eta 0:59:29^C

由于从国外网站下载相关软件包,速度较慢。可以指定国内源进行下载安装。此处通过-i选项指定清华源https://pypi.tuna.tsinghua.edu.cn/simple。 执行命令:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

代码语言:javascript
复制
[root@node1 ~]# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
Collecting tensorflow
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fe/dd/8764ae59e8ff74421d615ddb9c86a1b404c27708dfde3caa8f17c183788d/tensorflow-1.3.0-cp27-cp27mu-manylinux1_x86_64.whl (43.1MB)
    100% |████████████████████████████████| 43.1MB 9.5kB/s 
Collecting protobuf>=3.3.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9c/e4/993661ca20c57307561a14180757a7a3cb30c0283f416ff3040dca7d91d3/protobuf-3.4.0-cp27-cp27mu-manylinux1_x86_64.whl (6.2MB)
    100% |████████████████████████████████| 6.2MB 142kB/s 
Collecting six>=1.10.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting tensorflow-tensorboard<0.2.0,>=0.1.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fb/34/14c23665a725c73932891e09b8f017a53aad545c9d5019d2817102dc5d9b/tensorflow_tensorboard-0.1.8-py2-none-any.whl (1.6MB)
    100% |████████████████████████████████| 1.6MB 391kB/s 
Collecting wheel (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0c/80/16a85b47702a1f47a63c104c91abdd0a6704ee8ae3b4ce4afc49bc39f9d9/wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 1.0MB/s 
Collecting backports.weakref>=1.0rc1 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/88/ec/f598b633c3d5ffe267aaada57d961c94fdfa183c5c3ebda2b6d151943db6/backports.weakref-1.0.post1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.11.0 in /usr/lib64/python2.7/site-packages (from tensorflow)
Collecting mock>=2.0.0 (from tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e6/35/f187bdf23be87092bd0f1200d43d23076cee4d0dec109f195173fd3ebc79/mock-2.0.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 2.0MB/s 
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/site-packages (from protobuf>=3.3.0->tensorflow)
Requirement already satisfied (use --upgrade to upgrade): werkzeug>=0.11.10 in /usr/lib/python2.7/site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting html5lib==0.9999999 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ae/ae/bcb60402c60932b32dfaf19bb53870b29eda2cd17551ba5639219fb5ebf9/html5lib-0.9999999.tar.gz (889kB)
    100% |████████████████████████████████| 890kB 554kB/s 
Requirement already satisfied (use --upgrade to upgrade): markdown>=2.6.8 in /usr/lib/python2.7/site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting bleach==1.5.0 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/33/70/86c5fec937ea4964184d4d6c4f0b9551564f821e1c3575907639036d9b90/bleach-1.5.0-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock>=2.0.0->tensorflow)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/0c/5d/b077dbf309993d52c1d71e6bf6fe443a8029ea215135ebbe0b1b10e7aefc/pbr-3.1.1-py2.py3-none-any.whl (99kB)
    100% |████████████████████████████████| 102kB 1.3MB/s 
Requirement already satisfied (use --upgrade to upgrade): funcsigs>=1; python_version < "3.3" in /usr/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow)
Requirement already satisfied (use --upgrade to upgrade): ordereddict in /usr/lib/python2.7/site-packages (from funcsigs>=1; python_version < "3.3"->mock>=2.0.0->tensorflow)
Installing collected packages: six, protobuf, html5lib, wheel, bleach, tensorflow-tensorboard, backports.weakref, pbr, mock, tensorflow
  Found existing installation: six 1.9.0
    Uninstalling six-1.9.0:
      Successfully uninstalled six-1.9.0
  Running setup.py install for html5lib ... done
Successfully installed backports.weakref-1.0.post1 bleach-1.5.0 html5lib-0.9999999 mock-2.0.0 pbr-3.1.1 protobuf-3.4.0 six-1.11.0 tensorflow-1.3.0 tensorflow-tensorboard-0.1.8 wheel-0.30.0
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@node1 ~]# 

1.3 验证

下面通过查看TensorFlow版本信息来验证是否安装正确:

代码语言:javascript
复制
[root@node1 ~]# python
Python 2.7.5 (default, Aug  4 2017, 00:39:18) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> print(tf.__version__)
1.3.0
>>> 
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017-10-14 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • TensorFlow学习笔记:1、TensorFlow快速下载与安装
    • 1.1 安装python-pip
      • 1.2 安装TensorFlow
        • 1.3 验证
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档