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 ...
随机推荐
- Centos7 安装node(8版本)
最简洁的命令 yum -y update yum -y install gcc make gcc-c++ openssl-devel wget vim(后面两个如果没有再选择安装) cd /usr/l ...
- Sql2008R2 日志无法收缩解决方案
在网上查了二天资料,终于找到个解决了这个问题的方案,记录下来.方便下次处理. 解决方案转贴自: https://blog.csdn.net/kk185800961/article/detail ...
- JavaWeb——Servlet如何调用线程池中的线程?
tomcat线程池与servlet https://blog.csdn.net/qq_27817797/article/details/54025173 https://blog.csdn.net/l ...
- 对接京东jos遇到的坑 记录一下。方便查询
坑很多,有一些忘记了.文档乱的很,有问题可以私信我一下我看能不能想起来. 坑一.添加商品接口. {"error_response": {"code":" ...
- C++程序设计
C++程序设计 之前学过C++课程,但是时间有点久,忘了很多,这里做一个简单的回顾. 网站推荐: C++在线编译器 学习C++之前,您可以先了解C语言. c++的扩展名一般为cpp(cplusplus ...
- GraphQL 总结 + 在Django应用(Graphene)
由Xmind编辑,下次更新会附加python demo. 附件列表
- ubuntu16上安装openJDK.md
ubuntu16上安装openJDK.md 环境 操作系统:ubuntu 16.04.2 LTS 安装 当你不需要安装oracle的JDK时,使用openJDK,安装就比较方便. sudo apt-g ...
- 深入理解Solaris X64系统调用
理解系统调用的关键在于洞悉系统调用号是联系用户模式与内核模式的纽带.而在Solaris x64平台上,系统调用号被保存在寄存器RAX中,从用户模式传递到内核模式.一旦进入内核模式,内核的sys_sys ...
- Python基础(5) - 文件
Python Python提供的函数和方法方便地对文件进行读.写.删除等的操作. open()函数返回一个文件对象. open(name[, mode[, buffering]]) -> fil ...
- 学习Python要知道哪些重要的库和工具
本文转自:https://github.com/jobbole/awesome-python-cn 环境管理 管理 Python 版本和环境的工具 p:非常简单的交互式 python 版本管理工具. ...