ubuntu16.04安装tensorflow
来源:互联网 发布:苹果手机上看图软件 编辑:程序博客网 时间:2024/04/24 23:16
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
Create a virtualenv environment by issuing one of the following commands:
$ virtualenv --system-site-packages targetDirectory # for Python 2.7 $ virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n
where
targetDirectory
specifies the top of the virtualenv tree. Our instructions assume thattargetDirectory
is~/tensorflow
, but you may choose any directory.创建 Virtualenv 虚拟环境:
进入你想安装tensorflow的父目录下,然后执行下面命令建立虚拟环境:
1virtualenv --system-site-packages tensorflow
Activate the virtualenv environment by issuing one of the following commands:
$ source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh $ source ~/tensorflow/bin/activate.csh # csh or tcsh
The preceding source command should change your prompt to the following:
(tensorflow)$
Issue one of the following commands to install TensorFlow in the active virtualenv environment:
(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
If the preceding command succeeds, skip Step 6. If the preceding command fails, perform Step 6.
(Optional) If Step 5 failed (typically because you invoked a pip version lower than 8.1), install TensorFlow in the active virtualenv environment by issuing a command of the following format:
(tensorflow)$ pip install --upgrade tfBinaryURL # Python 2.7 (tensorflow)$ pip3 install --upgrade tfBinaryURL # Python 3.n
where
tfBinaryURL
identifies the URL of the TensorFlow Python package. The appropriate value oftfBinaryURL
depends on the operating system, Python version, and GPU support. Find the appropriate value fortfBinaryURL
for your system here. For example, if you are installing TensorFlow for Linux, Python 3.4, and CPU-only support, issue the following command to install TensorFlow in the active virtualenv environment:(tensorflow)$ pip3 install --upgrade \ https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp34-cp34m-linux_x86_64.whl
If you encounter installation problems, seeCommon Installation Problems.
测试安装:
在终端执行如下命令进入python shell环境:
python
在python shell环境中测试:
>>>
import
tensorflow as tf
>>> hello
=
tf.constant(
'Hello, TensorFlow!'
)
>>> sess
=
tf.Session()
>>>
print
(sess.run(hello))
Hello, TensorFlow!
>>> a
=
tf.constant(
10
)
>>> b
=
tf.constant(
32
)
>>>
print
(sess.run(a
+
b))
42
>>>
- Ubuntu16.04安装tensorflow
- Ubuntu16.04 Tensorflow安装
- ubuntu16.04 安装tensorflow
- ubuntu16.04安装tensorflow
- Ubuntu16.04安装TensorFlow教程
- Ubuntu16.04 安装Tensorflow-CPU
- Ubuntu16.04安装anaconda3+tensorflow
- ubuntu16.04安装tensorflow-gpu
- [TensorFlow] ubuntu16.04 pip3安装 TensorFlow
- Ubuntu16.04安装CUDA7.5+Caffe+tensorflow
- 基于ubuntu16.04 源码安装 tensorflow
- ubuntu16.04下安装TensorFlow(GPU加速)
- Ubuntu16.04快速安装/更新Tensorflow
- 在Ubuntu16.04下安装TensorFlow
- Ubuntu16.04+Anaconda 安装GPU版本tensorflow
- 深度学习tensorflow安装ubuntu16.04amd64
- Ubuntu16.04安装TensorFlow 1.2.0
- ubuntu16.04 python3安装opencv及tensorflow
- SharedPreferences存储
- 求矩阵的转置矩阵和两个矩阵相乘
- C/C++程序训练6---歌德巴赫猜想的证明
- B2B门户慧聪网的seo经典案例分析实测
- ssh的简单介绍与用法
- ubuntu16.04安装tensorflow
- springmvc controller接收jsp页面传过来的参数和传值到jsp页面
- 问题:‘tensorflow’ has no attribute 'select'
- Android-----SharedPreences工具类
- MongoDB的安装和使用
- java中实现同步的两种方式:syschronized和lock的区别和联系
- 虚拟机安装 Linux 系统
- Linux下设置和查看环境变量
- 1-我眼中的jvm