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 条评论
登录 后参与评论

相关文章

来自专栏挖坑填坑

Angular练习

1、安装node.js(其自带npm) 2、安装angular/cli 3、使用angular/cli构建项目参考这篇文章

905
来自专栏浅探ARKit

SceneKit动态加载.dae模型步骤详解

1.打开你的Xcode,在 /Contents/Developer/usr/bin/ 路径里找到 copySceneKitAssets 、 scntool 这2...

50713
来自专栏DeveWork

EaseMobile 主题导航菜单设置小图标的方法(图文+视频教程)

EaseMobile 主题的左侧的Off Canvas 侧边栏导航中是可以为每个菜单项设置小图标的。本文通过图文+视频教程为购买EaseMobile 主题的客户...

2028
来自专栏杂七杂八

matplotlib 中文乱码解决方案

在控制面板\外观和个性化\字体下找到黑体常规,复制到到盘符+文件夹\Anaconda\Lib\site-packages\matplotlib\mpl-data...

2356
来自专栏淡定的博客

使用cropper实现图片裁剪功能并保存图片到数据库

1172
来自专栏程序生活

Python爬虫系列(六)外国图库Unsplash图片自动化下载

再做一个网站,要找一些高清图片,然后同学推荐了这个网站:Unsplash 。但是每张图片下载要手动点,然后下拉加载更多图片,效率不高,所以自己写了爬虫程序,进...

4939
来自专栏Python、Flask、Django

Django The messages framework

1152
来自专栏运维小白

19.10 处理图形中的乱码

处理图形中的乱码 设置为中文后,zabbix图形的中文文字会显示小方框 这是因为在zabbix的字体库中没有中文字体,需要从windows上借用一个过来 vim...

18111
来自专栏ml

faster-rcnn在编译时遇到的一些问题

 1.在安装faster-rcnn事如果报这种错误    In file included from ./include/caffe/util/device_a...

46114
来自专栏知道一点点

表单填写进度提示效果

Fort.js 是一款用于时尚、现代的表单填写进度提示效果的 JavaScript 库,你需要做的就是添加表单,剩下的任务就交给 Fort.js 算法了,使用非...

691

扫码关注云+社区