Install tensorflow and test

发布时间:2017-6-29 10:04:20编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"Install tensorflow and test",主要涉及到Install tensorflow and test方面的内容,对于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



上一篇:计算4
下一篇:ActiveMQ 即时通讯服务 浅析

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

好贷网好贷款