L1aoXingyu / pytorch-beginner

pytorch tutorial for beginners
3k stars 1.09k forks source link

Fix Wrong Transform Normalize Operation in AutoEncoder #36

Closed LeiWang1999 closed 4 years ago

LeiWang1999 commented 4 years ago

08-autoencoder project use mnist dataset and All images in this dataset have the same shape (1,28,28) But, the normalize operation in your code is Below:

img_transform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
])

it show be like below:

img_transform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize([0.5], [0.5])
])