Installing TensorFlow on Ubuntu
1、安装方法有4种,官方推荐是第一种.
virtualenv(官方推荐)
"native" pip
Docker
Anaconda
2、基于virtualenv的安装方法:
1)、Install pip and virtualenv by issuing one of the following commands:
$ sudo apt-get install python-pip python-dev python-virtualenv # for Python 2.7
$ sudo apt-get install python3-pip python3-dev python-virtualenv # for Python 3.n
2)、把virtualenv安装到目录下: 其中targetDirectory 是你要安装的目录名称,假设我们使用目录名称为tensorfolw
$ virtualenv --system-site-packages targetDirectory # for Python 2.7
$ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n
3)、进入virtualenv环境下(假设上一步建立的目录名称为tensorfolw)
$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh
$ source ~/tensorflow/bin/activate.csh # csh or tcsh
执行命令后,出现这个画面:
(tensorflow)$
4)、安装tensorflow:建议先安装只CPU的版本
(tensorflow)$ pip install --upgrade tensorflow # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow # for Python 3.n
(tensorflow)$ pip install --upgrade tensorflow-gpu # for Python 2.7 and GPU
(tensorflow)$ pip3 install --upgrade tensorflow-gpu # for Python 3.n and GPU
如果这一步命令出现错误,说明pip version lower than 8.1
则执行下面的命令:
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp27-none-linux_x86_64.whl #python2.7 cpu only
5)、安装完成后,执行以下命令退出
(tensorflow)$ deactivate
6)、测试tensorflow是否安装成功
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
实际操作环境截图:

如果成功print了Hello TensorFlow的字符,说明安装成功
Installing TensorFlow on Ubuntu的更多相关文章
- Installing TensorFlow on Ubuntu or Windows
Installing TensorFlow on Ubuntu 显卡驱动:http://developer2.download.nvidia.com/compute/cuda/8.0/secure/P ...
- Installing Moses on Ubuntu 16.04
Installing Moses on Ubuntu 16.04 The process of installation To install requirements sudo apt-get in ...
- TensorFlow安装-ubuntu
windows下某些tensorflow例子跑不成功,比如https://www.tensorflow.org/tutorials/wide 中的例子报下面的错误:' 'NoneType' objec ...
- Installing python-ldap in Ubuntu
These are the steps to be followed to install python-ldap in Ubuntu. At first, sudo apt-get install ...
- 【Tensorflow】Ubuntu 安装 Tensorflow gpu
安装环境:Ubuntu 16.04lts 64位,gcc5.4 1.安装Cuda 1. 下载cuda toolkit. 下载cuda8.0 地址:https://developer.nvidia.co ...
- Compiling Xen-4.4 From Source And Installing It On Ubuntu Server (Amd-64)
First of all, you should install a clean Ubuntu Server (Amd-64) on your server. (Version 14.04 is st ...
- Installing PHP5 on Ubuntu Server
When installing PHP 5 from source I ran into the following problems and solutions: Problem:configure ...
- How to install tensorflow on ubuntu 18.04 64bit
Ans:pip install tensorflow (note: version number of pip and python must be consistent)
- Installing Redis on Ubuntu
wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable sudo ...
随机推荐
- 用selenium工具做软件自动化测试的面试题及答案
1.selenium中如何判断元素是否存在? 答:isElementPresent 2.selenium中hidden或者是display = none的元素是否可以定位到? 答:不可以定位到 3.s ...
- BellmanFord贝尔曼-福特算法
import java.util.ArrayList; import java.util.Scanner; /** * 贝尔曼-福特算法 * * Bellman - ford算法是求含负权图的单源最短 ...
- netty总结
eventLoopGroup中创建各个eventLoop处理线程,各个pipeLineHandler处理childEvent时是在自己的线程中, 全异步
- R 升级版本
从3.4.1 升级到最新 懒得去官网下载 在R studio 执行一下代码 install.packages("installr") library(installr) updat ...
- 问题记录——com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
最近在搞一个Spring boot + Mybatis + Mysql的项目,用Mybatis访问数据库时,报了如下的错误,先在网上搜索了,试了各种办法都不行, 奇葩的是,连接另外1个数据库又没问题. ...
- 封装element-ui的dialog组件
封装组件: <template> <div class="dialog-container"> <el-dialog title="titl ...
- Oracle 维护数据的完整性 一 约束
简介:约束用于确保数据库满足特定的商业规则.在Oracle中,约束包括以下几种: 1.not null 非空约束 该劣质不能为null 2.unique 唯一约束 ...
- MySQL修改数据表
ALTER [IGNORE] table tb_name alter_spec,alter_spec......... alter_specification: ADD [COLUMN] create ...
- selenium中等待元素的加载
在实际使用中,有时会出现一个元素还没有加载出来,导致无法获取,此时需要selenium处理来等待一段时间,此时处理方法有以下几种: 1.最笨.最简单但是最不推荐的方式: Thread.sleep(ti ...
- 事务的编写规范与Hibernate绑定session
一.事务的编写规范 1.事务的基本概念: 数据库事务(Database Transaction) ,是指作为单个逻辑工作单元执行的一系列操作,要么完全地执行,要么完全地不执行. 事务处理可以确保除非事 ...