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

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

1.1 安装python-pip

[root@node1 ~]# yum install -y python-pip

1.2 安装TensorFlow

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

[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

[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版本信息来验证是否安装正确:

[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
>>> 

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏深度学习与计算机视觉

手把手教你如何应用TF-Slim快速实现迁移学习

这是一篇以实践为主的入门文章,目的在于用尽量少的成本组织起来一套可以训练和测试自己的分类任务的代码,其中就会用到迁移学习,TF-Slim库的内容,所以我们分为下...

6058
来自专栏王磊的博客

图片人脸检测——Dlib版(四)

1443
来自专栏机器之心

业界 | Facebook 开源语音识别工具包wav2letter(附实现教程)

3808
来自专栏尾尾部落

mac OS 安装XGBoost

XGBoost是一种基于决策树(CART)的分布式的高效的梯度提升算法,它可被应用到分类、回归、排序等任务中,与一般的GBDT算法相比,XGBoost主要有以下...

804
来自专栏weixuqin 的专栏

facenet 进行人脸识别测试

2974
来自专栏人工智能LeadAI

YOLO:实时目标检测

一瞥(You Only Look Once, YOLO),是检测Pascal VOC(http://host.robots.ox.ac.uk:8080/pasc...

5057
来自专栏ATYUN订阅号

TensorFlow:使用Cloud TPU在30分钟内训练出实时移动对象检测器

是否能够更快地训练和提供对象检测模型?我们已经听到了这种的反馈,在今天我们很高兴地宣布支持训练Cloud TPU上的对象检测模型,模型量化以及并添加了包括Ret...

1245
来自专栏机器之心

资源 | 微软发布可变形卷积网络代码:可用于多种复杂视觉任务

选自Github 机器之心编译 编辑:吴攀 上个月,微软代季峰等研究者发布的一篇论文提出了一种可变形卷积网络,该研究「引入了两种新的模块来提高卷积神经网络(CN...

3226
来自专栏weixuqin 的专栏

facenet 进行人脸识别测试

2442
来自专栏AI研习社

Github 项目推荐 | GAN 非平稳纹理合成

该库是论文「Non-stationary texture synthesis using adversarial expansions.」的官方代码。

753

扫码关注云+社区