TensorFlow安装配置,茫茫人海中一瞥
深度学习的框架,我们熟知的有caffe,torch和convnet。最近,Google又搞了一个TensorFlow,已经开源:http://www.tensorflow.org/。据说,谷歌的深度学习研究人员都在用TensorFlow,未来也将在机器学习产品中继续使用。那么,作为小码农的我需要紧跟时代的步伐啊,探索一下这个新家伙。
本博文分为两个部分,第一个部分介绍TensorFlow的安装,第二部分探索一下TensorFlow的基本使用知识。
一. TensorFlow的安装
个人觉得TensorFlow的安装比前几个框架的安装简单。小码农我的系统是Ubuntu15.04,这里介绍一下Ubuntu下安装TensorFlow的方法,代码如下:
<span style="font-size:14px;"># For CPU-only version $ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl # For GPU-enabled version (only install this version if you have the CUDA sdk installed) $ pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl</span>
需要注意的是系统已经安装好python,假如使用的GPU,还需要把GPU的驱动安装好。GPU驱动安装可参考:http://blog.csdn.net/helei001/article/details/46950853
如果你是其他的系统,请参考网页:http://www.tensorflow.org/get_started/os_setup.md
二. TensorFlow的基本使用
TensorFlow的使用与python的运算库一样,负责与硬件打交道的是session,用来驱动GPU或者CPU。话不多说,上代码:
<span style="font-size:14px;">import tensorflow as tf # The value returned by the constructor represents the output of the Constant op. matrix1 = tf.constant([[3., 3.]]) # Create another Constant that produces a 2x1 matrix. matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) sess = tf.Session() result = sess.run(product) print result # Close the Session when we're done. sess.close()</span>
参考链接:
http://www.tensorflow.org/get_started
推荐资料:
[1] first-contact-with-tensorflow
[2] http://learningtensorflow.com/
[3] https://hackerlists.com/tensorflow-resources/
最新文章
- ES5语法
- nancy中视图呈现 Html.Partial(RenderPage的替代品)
- Angular从0到1:function(下)
- JAVA - JAVA编译运行过程
- w3m常用快捷键
- BaiduMap Search List
- 消息框用法MessageBox
- 【EasyUI】Combobox的联动和onChange/onSelect事件绑定
- MVVM模式中WPF数据的完全绑定
- rowid结构浅析
- Python源代码剖析笔记3-Python运行原理初探
- dede织梦怎么修改description的字数
- 【NOIP2004】【CJOJ1703】【洛谷1092】虫食算
- ubuntu 16.04 安装 ssh
- angualr Material Icons
- CSS3性能体验
- matlab生成滤波器系数组
- JMS学习(二)之ActiveMQ
- Oracle 将另外一张表的列更新到本表的列
- 2018.10.22 cogs2471. [EZOI 2016]源氏的数学课(线段树)
热门文章
- Log4j使用详解
- combobox数据绑定
- select动态绑定vue.js
- 41. First Missing Positive(困难, 用到 counting sort 方法)
- python--ftp服务器(pyftpdlib)
- Swift中的可选协议和方法的历史渊源
- Xcode Organizational Identifiers
- mysql字符集,insert,update,delete,select
- [lua]luasocket.c:20:17: fatal error: lua.h: No such file or directory
- 有n个数,输出其中所有和为s的k个数的组合。