Your model seems to be fine. Try to flatten the input.
I assume your image has the following dimensions: [batch_size, 3, 256, 256].
Add x.view(x.size(0), -1) to your forward method:
def forward(self, x):
        x = x.view(x.size(0), -1)
        x = self.encoder(x)
        x = self.decoder(x)
        return x