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

相关文章

来自专栏IT进修之路

原 荐 SpringBoot整合mybati

1643
来自专栏10km的专栏

linux下用cmake对caffe静态编译时-static-libstdc++参数无效的问题

以下是用于cmake 生成 Makefile文件对Caffe进行静态库连接编译的shell脚本, #!/bin/bash # cmake 静态编译 caffe-...

4016
来自专栏张戈的专栏

远程桌面报错解决:No Remote Desktop License Servers Available

摘 要 用户发来反馈,使用部门Windows跳板机报错:The remote session was disconnected because there a...

5437
来自专栏专注数据中心高性能网络技术研发

安装glog和gflags

1.下载 git clone https://github.com/google/glog 2.配置 sudo apt-get install autoconf...

5645
来自专栏IMWeb前端团队

React Router Load On Demand

本文作者:IMWeb 陈映平 原文出处:IMWeb社区 未经同意,禁止转载 It is frequently asked that how to lo...

2245
来自专栏一个会写诗的程序员的博客

RESTFeel: 一个企业级的API管理&测试平台。RESTFeel帮助你设计、开发、测试您的APIRESTFeel功能简介:MongoDB configuration:Building From

The build file is configured to download and use an embedded Tomcat server. So t...

1004
来自专栏向治洪

ActivityManagerService启动过程分析

之前讲Android的View的绘制原理和流程的时候,讲到过在Android调用setContentView之后,Android调用了一个prepreTravl...

2178
来自专栏程序猿DD

Spring Boot中使用Actuator的/info端点输出Git版本信息

对于Spring Boot的Actuator模块相信大家已经不陌生了,尤其对于其中的/health、/metrics等强大端点已经不陌生(如您还不了解Actua...

2497
来自专栏个人分享

spark单机模式简单搭建

待安装列表 hadoop hive scala spark 一.环境变量配置: ~/.bash_profile PATH=$PATH:$HOME/bin

2351
来自专栏杨建荣的学习笔记

dg broker校验失败的一个奇怪问题(二) (r8笔记第51天)

对昨天提出的问题做了一个简单的分析和排查,也算是有了一个交代,上一篇文章在 dg broker校验失败的一个奇怪问题 我查看了最近的日志,发现在半个月以前有一...

3435

扫码关注云+社区