Open diviramon opened 3 years ago
Try this:
transformList = [Transforms.Grayscale(1)] + transformList[:len(transformList)-1] + [Transforms.Normalize((0.5,),(0.5,))]
This fixed it for me: https://github.com/facebookresearch/pytorch_GAN_zoo/issues/122#issue-729236995
https://github.com/facebookresearch/pytorch_GAN_zoo/blob/b75dee40918caabb4fe7ec561522717bf096a8cb/models/trainer/gan_trainer.py#L423
As it is right now, it will through an error when using 1 channel images since they are converted to GrayScale first then a transform on three channels (0.5,0.5,0.5) is applied.