mila-iqia/blocks

Serialization uses GPU even with CPU flag

Thrandis opened this issue · 2 comments

THEANO_FLAGS=device=cpu python -c 'from blocks.serialization import dump'
/Tmp/lisa/os_v5/anaconda/lib/python2.7/site-packages/skcuda/cublas.py:273: UserWarning: creating CUBLAS context to get version number warnings.warn('creating CUBLAS context to get version number')

Basically if I try to use dump on CPU, blocks is still initializing a free GPU. I think that

try:
    import pygpu
except:
    pygpu = None

should be depending on the THEANO_FLAGS, and pygpu should not be imported when the flag is not set to cuda.

dwf commented

Agreed.

dwf commented

Fixed by #1149.