I'm new to Theano. Trying to set up a config file.
First of all, I notice that I have no .theanorc file:
locate .theanorc
- returns nothingecho $THEANORC
- returns nothingtheano.test()
- passes okI'm guessing some default configuration was created wen i installed theano. Where is it?
Default: On Windows: $LOCALAPPDATA\Theano if $LOCALAPPDATA is defined, otherwise and on other systems: ~/. theano.
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.
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.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With