znxlwm / pytorch-generative-model-collections

Collection of generative models in Pytorch version.
2.59k stars 546 forks source link

RuntimeError: output with shape [1, 28, 28] doesn't match the broadcast shape [3, 28, 28] #32

Closed killuaZold closed 3 years ago

killuaZold commented 3 years ago

i run the original code,but i get this problem.and i don't know why can you help me thx (👍

killuaZold commented 3 years ago

i fixed the problem i think you should change the following code transform = transforms.Compose([transforms.Resize((input_size, input_size)), transforms.ToTensor(), transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))])

transform = transforms.Compose([ transforms.Resize(32), transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,)) ])