Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much time "import theano" takes to run?

I am taking first baby steps with Theano on Windows for deep learning experiments, and I'm surprised how much it takes just loading the library.

Here is the little test program :

from time import time
t0 = time()
import theano
t1 = time()
print 'import theano takes %f' %(t1-t0)

results in my PyCharm console :

C:\Anaconda\python.exe X:/DAR_EPT/DNN/dnn_tuto1.py
Using gpu device 0: Quadro K2000M
import theano takes 23.044000 seconds

:-o

Is it normal behaviour ? Should I reinstall everything ?

Here is my configuration :

Windows 7. Python 2.7.8 in "Anaconda" package. CUDA 6.5. GPU : Nvidia Quadro K2000M.

Here is the .theanorc file :

[global]
floatX = float32
device = gpu

[nvcc]
fastmath = True
like image 334
Etienne Perot Avatar asked Dec 07 '25 22:12

Etienne Perot


1 Answers

It generally takes a long time to import theano when configured to use a GPU. On my machine it takes 0.567 seconds when running on CPU and 13.3 seconds when running on GPU.

This may be one reason why to develop on CPU initially and switch to GPU once you've got it running right. The GPU overhead, including the increased Theano startup time, needs to be considered in determining whether running on a GPU is actually worthwhile.

like image 185
Daniel Renshaw Avatar answered Dec 10 '25 03:12

Daniel Renshaw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!