Step by Step Ubuntu下GPU测试Theano
来源:互联网 发布:电脑语音同声翻译软件 编辑:程序博客网 时间:2024/06/03 18:31
刚刚开始学习Deep Learning
OS:Ubuntu 14.04 CPU:I7-4700MQ GPU:GT 750M
是在这个网站下学习的:http://deeplearning.net
安装Theano:http://deeplearning.net/software/theano/install.html#install安装过程很简单,一步一步做就行了。
使用GPU测试Theano,复制下面的python代码,自建一个py文件:
以下是执行结果:
THEANO_FLAGS=mode=FAST_RUN,device=cpu,floatX=float32 python check1.py[Elemwise{exp,no_inplace}(<TensorType(float32, vector)>)]Looping 1000 times took 2.16374897957 secondsResult is [ 1.23178029 1.61879337 1.52278066 ..., 2.20771813 2.29967761 1.62323284]Used the cpu</pre><pre name="code" class="plain">sudo THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python check1.pyUsing gpu device 0: GeForce GT 750M[GpuElemwise{exp,no_inplace}(<CudaNdarrayType(float32, vector)>), HostFromGpu(GpuElemwise{exp,no_inplace}.0)]Looping 1000 times took 0.532066106796 secondsResult is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761 1.62323296]Used the gpu
对比以上结果:1)执行命令中:前者device=cpu,或者device=gpu
2)显示结果中,比较明显的不同是:Used the cpu计算时间超过2秒,同样的文件Used the gpu计算时间仅用了0.53秒
另外,在我自己执行的过程中,遇到一个问题:
THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python check1.pyWARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: Unable to get the number of gpus available: unknown error)[Elemwise{exp,no_inplace}(<TensorType(float32, vector)>)]Looping 1000 times took 2.19189310074 secondsResult is [ 1.23178029 1.61879337 1.52278066 ..., 2.20771813 2.29967761 1.62323284]Used the cpu执行命令是device=gpu,但是执行结果出现error,并且计算使用的是cpu。error显示是不能获得可用的gpu,其实是权限问题,只要在执行命令前加上sudo,就可以了。
0 0
- Step by Step Ubuntu下GPU测试Theano
- ubuntu use step by step
- ubuntu环境下编译内核step by step
- ubuntu环境下编译内核step by step
- 网络安装Ubuntu - step by step
- Step-by-step Install Guide for Ubuntu
- step by step 安装svn for ubuntu
- 学习下Django Step by Step (七)
- NHibernate Step by Step
- OGRE step by step
- step by step
- MinGW Step by Step
- 大杂烩---Step by Step
- sphinx4 STEP BY STEP
- EJB step by step
- NHibernate Step by Step
- Django Step by Step
- Eclipse: Step by Step
- [LeetCode] Surrounded Regions, Solution
- Leetcode NO.60 Permutation Sequence
- 排序算法(一)- 冒泡排序
- 排序算法(二)- 快速排序
- 安装 CentOS 7 后必做的七件事
- Step by Step Ubuntu下GPU测试Theano
- Leetcode NO.50 Pow(x, n)
- 使用nat123来用外网访问内网SVN-https443映射方法
- asp.net,jsp,php,安卓Android,ios计算机毕业课程设计源码免费打包下载
- Xsolla对话成都游戏茶馆CEO
- Android入门第八篇之GridView(九宫图)
- Natural Language Processing (nlp) 路线图
- BZOJ 2982 combination Lucas定理
- iOS strong 和weak的形象理解(真的很精典!)