caffe icon indicating copy to clipboard operation
caffe copied to clipboard

NaNs in forward pass of lrn_layer across_channel normalization

Open AlexBinder opened this issue 11 years ago • 0 comments

Hi all,

the problem appears when finetuning with custom data, a learning rate of 0.01, momentum = 0.9

what happens is (for lrn_layer.cu) that scale[index]<0 occurs in global void LRNComputeOutput(const int nthreads, const Dtype* const in, const Dtype* const scale, const Dtype negative_beta, Dtype* const out) { CUDA_KERNEL_LOOP(index, nthreads)

applying a pow with beta < 1 then leads to NaNs,

I am working for CVPR deadline, this puts me a bit in stress. My question is: is it a reasonable hotfix to apply an abs to scale[index] ?

or better set alpha from 1e-4 to 1e-9 ? and effectively prohibit local renormalization ?

Any better solutions?

I guess in this across scale adding and substracting negative results should not occur? Am I wrong ?

addendum: the same problem also happens in cpu mode.

addendum: more info: I use the caffe-master from 3rd October 2015. cannot upgrade to a newer version because my version has some relevance propagation code added. Has there been some problem with lrn layers fixed since october 2015 ?

Best regards, Alex

AlexBinder avatar Nov 05 '15 13:11 AlexBinder