MixMatch-pytorch icon indicating copy to clipboard operation
MixMatch-pytorch copied to clipboard

wrong transform order

Open yuanzhanghu opened this issue 4 years ago • 1 comments

In CIFAR10_labeled class, we have: self.data = transpose(normalise(self.data)) inside the __init__(), while we do transform for each item in __get_item__()

Which means we do normalization first, then when we call labeled_train_iter.next() in train.py, we do these image transform after normalization, which I believe is not reasonable. these transforms include: dataset.RandomPadandCrop(32), dataset.RandomFlip()

yuanzhanghu avatar Nov 14 '20 01:11 yuanzhanghu

I agree with you. And if we use transforms in torchvision.transforms, we can learn that the transforms.Normalize can only be applied to tensor, which means it should be used after all image transforms

sakumashirayuki avatar Nov 15 '20 13:11 sakumashirayuki