Your advice is really helpful. I mixed int64 and float32 in my code and didn't notice it until reading your post here.
Thanks a lot. 在 2015年7月15日星期三 UTC+8下午2:54:10,Daniel Renshaw写道: > > I've encountered similar situations in the past but I think in every case > it could always be tracked down to an unexpected introduction of a > precision hike in my own code which I only noticed via the gradient. > > For example, check for operations that involve functions of shapes. Shape > values are always int64s and a binary operation involving a float32 and an > int64 produces a float64. > > As already noted, warn_float64 is useful to find cases like this. > > Daniel > > > On 14 July 2015 at 23:20, Frédéric Bastien <[email protected] > <javascript:>> wrote: > >> What you describe should not happen. Update to Theano development version >> and try again. Maybe it is already fixed. >> >> If not, use the Theano flag warn_float64=True to find where float 64 are >> created. >> >> Fred >> >> Le mar. 14 juil. 2015 13:12, Nima Mousavi <[email protected] >> <javascript:>> a écrit : >> >>> Hey there, >>> >>> I have installed Theano on a mac and added >>> >>> [global] >>> floatX = float32 >>> >>> to my .theanorc. >>> >>> For some reason the grad function produces float64 values though. I'm >>> 100% sure >>> that the float64 values are produced by the grad function. After >>> manually casting >>> them to float32 my program works again. But, if possible, I'd like to >>> know the reason. >>> >>> Thanks your help is appreciated >>> >>> -- >>> >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "theano-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] <javascript:>. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "theano-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
