Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up theano config

Tags:

theano

I'm new to Theano. Trying to set up a config file.

First of all, I notice that I have no .theanorc file:

  1. locate .theanorc - returns nothing
  2. echo $THEANORC - returns nothing
  3. theano.test() - passes ok

I'm guessing some default configuration was created wen i installed theano. Where is it?

like image 902
eran Avatar asked Feb 06 '14 16:02

eran


People also ask

Where is theano config?

Default: On Windows: $LOCALAPPDATA\Theano if $LOCALAPPDATA is defined, otherwise and on other systems: ~/. theano.

How do I activate theano GPU?

Testing Theano with GPU To see if your GPU is being used, cut and paste the following program into a file and run it. Use the Theano flag device=cuda to require the use of the GPU. Use the flag device=cuda{0,1,...} to specify which GPU to use. The program just computes exp() of a bunch of random numbers.

Does theano use GPU?

Theano has a feature to allow the use of multiple GPUs at the same time in one function. The multiple gpu feature requires the use of the GpuArray Backend backend, so make sure that works correctly.


2 Answers

Theano does not create any configuration file by itself, but has default values for all its configuration flags. You only need such a file if you want to modify the default values.

This can be done by creating a .theanorc file in your home directory. For example, if you want floatX to be always float32, you can do this:

echo -e "\n[global]\nfloatX=float32\n" >> ~/.theanorc 

under Linux and Mac. Under windows, this can also be done. See this page for more details:

http://deeplearning.net/software/theano/library/config.html

like image 165
nouiz Avatar answered Sep 19 '22 09:09

nouiz


In Linux in terminal Home directory write:

nano .theanorc 

In the file copy the following lines

[global] floatX = float32 device = gpu0  [lib] cnmem = 1    

Save it.

When I import theano in python I was having cnmem memory problems. Seems that is because the monitor is connected to the gpu. To resolve it change cnmem to 0.8. This number below 1 is the percentage of gpu reserved for theano

like image 24
Farrael15 Avatar answered Sep 18 '22 09:09

Farrael15