Install tensorflow and test

1. Introduction

TensorFlow is a programming system in which you represent computations as graphs. Nodes in the graph are called ops (short for operations). An op takes zero or more Tensors, performs some computation,and produces zero or more Tensors. A Tensor is a typed multidimensional array.
To use TensorFlow you need to understand how TensorFlow:
• Represents computations as graphs.
• Executes graphs in the context of Sessions.
• Represents data as tensors.
• Maintains state with Variables.
• Uses feeds and fetches to get data into and out of arbitrary operations

2 . Environment

$ uname -a
Linux jason-virtual-machine 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

3 . Installing

$ sudo apt-get install python-pip python-dev

$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl

4 . Testing

vim hellotensorflow.py

import tensorflow as tf

hello = tf.constant('hello, TensorFlow!')
sess = tf.Session()
print sess.run(hello)

a = tf.constant(10)
b = tf.constant(32)
print sess.run(a+b)

$ python hellotensorflow.py

hello, TensorFlow!
42


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

路漫漫其修远.

你的鼓励是我寻找真相的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值