pytorch.sngan_projection icon indicating copy to clipboard operation
pytorch.sngan_projection copied to clipboard

bug in fid: normalization

Open youngjung opened this issue 5 years ago • 3 comments

Hi, I found a bug in fid score.

The normalization before inception model is written as: https://github.com/crcrpar/pytorch.sngan_projection/blob/7afdca4a0e4f2df2efbb585133cccb216b348545/models/inception.py#L128-L132

but it should be: https://github.com/mseitzer/pytorch-fid/blob/4e366b2fc9fb933bec9f6f24c5e87c3bd9452eda/inception.py#L130-L131

or it should be fixed like:

if self.normalize_input:
    mean = torch.tensor((0.485, 0.456, 0.406)).view(1, 3, 1, 1).cuda()
    std = torch.tensor((0.229, 0.224, 0.225)).view(1, 3, 1, 1).cuda()
    x = (x - mean) / std

youngjung avatar May 09 '19 06:05 youngjung

Thank you for your report & suggestion!

I'm sorry for my late response and bothering you by my bad. To be honest, I did not test/use FID scores.

crcrpar avatar May 23 '19 08:05 crcrpar

Oh, I did not mean to blame you but just wanted to help your repo and other users. Thanks for your response :)

youngjung avatar May 24 '19 05:05 youngjung

Oh, I did not mean to blame you but just wanted to help your repo and other users.

Thank you for your kind words.

I added the link to this issue tentatively to clarify what is wrong & how to fix this.

crcrpar avatar May 24 '19 05:05 crcrpar