使用gpu加速theano
来源:互联网 发布:雕刻机画图软件 编辑:程序博客网 时间:2024/05/19 06:15
测试的代码为
from theano import function, config, shared, tensorimport numpyimport timevlen = 10 * 30 * 768 # 10 x #cores x # threads per coreiters = 1000rng = numpy.random.RandomState(22)x = shared(numpy.asarray(rng.rand(vlen), config.floatX))f = function([], tensor.exp(x))print(f.maker.fgraph.toposort())t0 = time.time()for i in range(iters): r = f()t1 = time.time()print("Looping %d times took %f seconds" % (iters, t1 - t0))print("Result is %s" % (r,))if numpy.any([isinstance(x.op, tensor.Elemwise) and ('Gpu' not in type(x.op).__name__) for x in f.maker.fgraph.toposort()]): print('Used the cpu')else: print('Used the gpu')运行cpu的代码为
THEANO_FLAGS=device=cpu python gpu_tutorial1.py运行gpu的代码为
THEANO_FLAGS=device=cuda0 python gpu_tutorial1.py
0表示使用编号为0的进行训练
[1] theano文档
阅读全文
0 0
- 使用gpu加速theano
- 使用GPU和Theano加速深度学习
- 使用GPU和Theano加速深度学习
- 配置使用GPU加速的Theano环境
- Theano利用GPU加速
- 在ubuntu14.10上安装theano并且使用GPU加速
- GPU 加速NLP任务(Theano+CUDA)
- GPU 加速NLP任务(Theano+CUDA)
- 深度学习框架Theano利用GPU加速
- 64位Windos10+theano+VS2012+GPU加速
- 【深度学习】win10+Theano+GPU加速配置
- Theano 配置记(Anaconda+Theano 0.7+GPU加速+VS2010)
- Theano(Deep Learning Tool) 利用GPU来进行加速的配置及使用
- 在我的Macbook Pro上安装能使用GPU加速的Theano
- Windows 7(10) 下安装 tensorflow,theano,keras并使用GPU加速。
- 使用 GPU 加速计算
- windows下的theano以及GPU加速环境的搭建
- Theano下怎么配置GPU和cudnn加速
- Node.js的Buffer那些你可能不知道的用法
- 青鸟教育系统-教室管理jsp页面
- 2017-8-29工作记录
- 悲剧,闹剧
- css伪类选择器,:link、:visited、:focus、:hover、:active、:first-child
- 使用gpu加速theano
- 浅析 Netty心跳机制
- 青鸟教育系统-教室管理js页面
- css伪元素选择器,first-letter、first-line
- 第一次技术面试-美团一面
- 编码乱码问题
- jQuery零碎总结
- C++ Primer 第2章 变量和基本类型
- hibernate get和load区别