facebookresearch / pytorch_GAN_zoo

A mix of GAN implementations including progressive growing
BSD 3-Clause "New" or "Revised" License
1.61k stars 271 forks source link

Bug with grayscale image normalization #122

Open mirandali707 opened 4 years ago

mirandali707 commented 4 years ago

While running PGAN to produce grayscale output, I think I found a bug in this line -- after the grayscale transform there's only one channel, so Transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)) fails with RuntimeError: output with shape [1, 4, 4] doesn't match the broadcast shape [3, 4, 4]. I fixed this by adding transformList[-1] = Transforms.Normalize([0.5], [0.5]) after line 423.