2

In my .theanorc file I have set the parameter...

[global]
floatX = float32

However when I run keras with the theano backend and make calls to model.predict the numpy datatype of the returned array is always of type FP64 not FP32. I am not sure if this is a problem or if keras / theano makes a conversion to FP32 before executing on the GPU. Is there a way to check. I would like it if theano could post and error or warning if I try to use FP64 on the GPU.

talonmies
  • 70,661
  • 34
  • 192
  • 269
chasep255
  • 11,745
  • 8
  • 58
  • 115

1 Answers1

3

To check the type of floatX you can simply run

import theano
print theano.config.floatX

If that code prints 'float32' then theano will print out a warning when you try to use float64 as input for gpu computations. This can be suppressed though if you add the keyword argument allow_downcast, so make sure that you don't have this keyword in theano.function when you are compiling the graph.

Makis Tsantekidis
  • 2,698
  • 23
  • 38