PyTorch-CIFAR-10-autoencoder icon indicating copy to clipboard operation
PyTorch-CIFAR-10-autoencoder copied to clipboard

Pretrained model does not match the model definition

Open nisha1729 opened this issue 4 years ago • 4 comments

The pre-trained model weights could not be loaded to the current model definition. I changed the model to

self.encoder = nn.Sequential(
            nn.Conv2d(3, 32, 4, stride=2, padding=1),            # [batch, 12, 16, 16]
            nn.ReLU(),
            nn.Conv2d(32, 48, 3, stride=2, padding=1),           # [batch, 24, 8, 8]
            nn.ReLU(),
        )
        self.decoder = nn.Sequential(
		    nn.ConvTranspose2d(48, 32, 3, stride=2, padding=1),  # [batch, 24, 8, 8]
            nn.ReLU(),
			nn.ConvTranspose2d(32, 3, 4, stride=2, padding=1),   # [batch, 12, 16, 16]
            nn.ReLU(),
        )

Now the code works, but the reconstruction is quite bad. image

Do you have a different pre-trained model that can be used? Thanks!

nisha1729 avatar Jul 26 '21 10:07 nisha1729

I have the same question too!It seems that the author didn't provides the right weights?

ColdAsYou165 avatar Jul 16 '22 03:07 ColdAsYou165

Have you solved the problem yet

ColdAsYou165 avatar Jul 16 '22 03:07 ColdAsYou165

I just retrained the model 😅

nisha1729 avatar Jul 16 '22 14:07 nisha1729

I got the same problem

Wsine avatar Sep 13 '22 11:09 Wsine