0
votes

I wrote a Theano machine learning program. But I got two absolutely different results between on CPU and on GPU.

Below is the log.(only a tiny part of log)

result on GPU

result on CPU

The loss function will quickly decrease and then converg to 0.2 on CPU.

However, the loss function will increase and finally become NaN on GPU.

What mistakes may be in my program? Or what should I take into attention? Thank you!

2

2 Answers

0
votes

Could it be that CPU is using float64 (double precision) and the GPU is using float32 (single precision)? Here you can look up the configuration flags: http://deeplearning.net/software/theano/library/config.html

0
votes

Check out this thread... https://github.com/fchollet/keras/issues/511 Basically adding;

optimizer_excluding=cudnn 

in the .theanorc solved it for me, but solution runs a slower.