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 ...
随机推荐
- golang笔记
----------- golang打包和部署到centos7. 参考:https://blog.csdn.net/qq_33230584/article/details/81536572
- C# 直接创建一个DataTable,并为之添加数据(自定义DataTable) 转
DataTable dt=new DataTable("cart"); DataColumn dc1=new DataColumn("prizename",Ty ...
- selenium IDE 命令二(断言、验证、等待、变量)
测试用例需要做断言和验证,在seleniumIDE中提供了断言和验证来对结果进行比较 首先通过打开seleniumIDE,在页面任意一个元素右键,选择最后一个选项“show all available ...
- tomcat端口冲突解决 Address already in use: JVM_Bind <null>:8080
java.net.BindException: Address already in use: JVM_Bind <null>:8080 Caused by: java.net.BindE ...
- 架构实战项目心得(十四):spring-boot结合Swagger2构建RESTful API测试体系
一.添加依赖: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-s ...
- [转]浅谈 .NET Framework 与 .NET Core 的区别与联系
本文转自:http://www.cnblogs.com/huchaoheng/p/6295688.html 2017到了,咱们学点啥啊,要想知道学点啥,先弄清.NET Framework 与 .NET ...
- WPF TextBox 聚焦
1.利用行为 http://blog.csdn.net/lianchangshuai/article/details/9223125 2. 利用装饰器 http://stackoverflow.com ...
- C++命名空间使用代码
namesp.h #pragma once #include <string> namespace pers { using namespace std; struct Person { ...
- asp.net core2.0 连接mysql和mssql
转自:https://www.jianshu.com/p/15a557ac43d9 1.连接mysql 第一步,新建asp.net core项目 新建项目 本例程作简单演示两种数据库的连接,为简便 ...
- 2017年12月13日 LinQ用法基本的增删改查
LinQ是什么? LinQ是语言集成的查询,是用于C#跟Vb的扩展语言 LinQ的用法 新建一个App_Code文件夹,在文件夹下添加一个数据LinQ to SQL类,可以直接直接点击服务器管理器然后 ...