tensorflow 查看值
- 作者: 往事卜必眷恋
- 来源: 51数据库
- 2020-09-30
官网:
安装步骤:
1、sudo apt-get install python-pip
python-dev python-virtualenv
2、virtualenv --system-site-packages ~/tensorflow
3、cd ~/tensorflow
4、source bin/activate # If using bash
5、(tensorflow)$ pip
install --upgrade tensorflow-0.5.0-cp27-none-linux_x86_64.whl
测试:
1、打开终端输入cd tensorflow
2、source bin/activate
3、python
4、输入python后输入以下示例
>>> 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
>>>
5、测试成功接下来首先退出python 按快捷键Ctrl+D
6、再退出tensorflow 在命令行输入命令:deactivate
本使用使用 tensorflow. 图中的节点被称之为 op (operation 的缩写), 这四个维度分别是 [batch. 一个 op 获得 0 个或多个 tensor. 通过 变量 (variable) 维护状态. 在被称之为 会话 (session) 的上下文 (context) 中执行图, 你可以将一小组图像集表示为一个四维浮点数数组, 使用图来表示计算任务. 例如. 使用 feed 和 fetch 可以为任意的操作(arbitrary operation) 赋值或者从其中获取数据. 使用 tensor 表示数据. 每个 tensor 是一个类型化的多维数组, 产生 0 个或多个 tensor, 执行计算. 综述 tensorflow 是一个编程系统, height, 你必须明白 tensorflow, channels]: 使用图 (graph) 来表示计算任务, width
安装步骤:
1、sudo apt-get install python-pip
python-dev python-virtualenv
2、virtualenv --system-site-packages ~/tensorflow
3、cd ~/tensorflow
4、source bin/activate # If using bash
5、(tensorflow)$ pip
install --upgrade tensorflow-0.5.0-cp27-none-linux_x86_64.whl
测试:
1、打开终端输入cd tensorflow
2、source bin/activate
3、python
4、输入python后输入以下示例
>>> 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
>>>
5、测试成功接下来首先退出python 按快捷键Ctrl+D
6、再退出tensorflow 在命令行输入命令:deactivate
本使用使用 tensorflow. 图中的节点被称之为 op (operation 的缩写), 这四个维度分别是 [batch. 一个 op 获得 0 个或多个 tensor. 通过 变量 (variable) 维护状态. 在被称之为 会话 (session) 的上下文 (context) 中执行图, 你可以将一小组图像集表示为一个四维浮点数数组, 使用图来表示计算任务. 例如. 使用 feed 和 fetch 可以为任意的操作(arbitrary operation) 赋值或者从其中获取数据. 使用 tensor 表示数据. 每个 tensor 是一个类型化的多维数组, 产生 0 个或多个 tensor, 执行计算. 综述 tensorflow 是一个编程系统, height, 你必须明白 tensorflow, channels]: 使用图 (graph) 来表示计算任务, width
推荐阅读
