rgeirhos / texture-vs-shape

Pre-trained models, data, code & materials from the paper "ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness" (ICLR 2019 Oral)
https://openreview.net/forum?id=Bygh9j09KX
Other
785 stars 101 forks source link

object detection loss NaN #4

Closed waterbearbee closed 5 years ago

waterbearbee commented 5 years ago

Hi Robert Geirhos,

I am currently creating an experiment of object detection with your pertained model. But unfortunately, the loss becomes NaN at the beginning. Then I reread your paper and find that you apply input whitening for image processing. So, I really want to know the reason and the impact of this processing.

Kind Regards!

michaelisc commented 5 years ago

The object detection implementation we use preprocesses images by subtracting the mean intensity of each color channel (in lib/model/utils/blob.py):

im -= pixel_means

In contrast the PyTorch ImageNet training we used to train our ImageNet models preprocesses images by normalizing the pixel values to [0,1] followed by channel wise subtraction of the mean and division by the standard deviation. Thus we changed our object detection preprocessing to follow the same procedure:

im = im/255
im -= [0.485, 0.456, 0.406]
im = im/[0.229, 0.224, 0.225]