Increasing image size in pytorch celebrity generating GAN? complete newbie here, bear with me.
I'm making my way through this tutorial: https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html
Upon attempting to make a simple change to the image parameters. I want to change the size variables. I basically go and set:

ngf = 120
ndf = 120

and turn image_size = 64 to image_width = 120, image_height=80, and use it here:

transforms.Resize(image_height, image_width),
transforms.CenterCrop(image_width),

I tried several  variations of course, but on the training bit of the code I get the following unhelpful error:

I'm new to both pytorch and python, so can I have a more accessible explanation of how it gets those numbers and what a fix would look like?
Thanks in advance!
 A: You probably know the answer by now, but here I'll explain this for those who dont know what is happening here.
When you want to change the image size, you also need to change your Discriminator and Generators networks. Both of these networks were designed with a specific image size in mind (e.g 64x64 in our case).  
Take this discriminator for example : 
class Discriminator(nn.Module):
    def __init__(self, ngpu):
        super(Discriminator, self).__init__()
        self.ngpu = ngpu
        self.main = nn.Sequential(
            # input is (nc) x 64 x 64
            nn.Conv2d(nc, ndf, 4, 2, 1, bias=False),
            nn.LeakyReLU(0.2, inplace=True),
            # state size. (ndf) x 32 x 32
            nn.Conv2d(ndf, ndf * 2, 4, 2, 1, bias=False),
            nn.BatchNorm2d(ndf * 2),
            nn.LeakyReLU(0.2, inplace=True),
            # state size. (ndf*2) x 16 x 16
            nn.Conv2d(ndf * 2, ndf * 4, 4, 2, 1, bias=False),
            nn.BatchNorm2d(ndf * 4),
            nn.LeakyReLU(0.2, inplace=True),
            # state size. (ndf*4) x 8 x 8
            nn.Conv2d(ndf * 4, ndf * 8, 4, 2, 1, bias=False),
            nn.BatchNorm2d(ndf * 8),
            nn.LeakyReLU(0.2, inplace=True),
            # state size. (ndf*8) x 4 x 4
            nn.Conv2d(ndf * 8, 1, 4, 1, 0, bias=False),
            nn.Sigmoid()
        )

    def forward(self, input):
        return self.main(input)

As you can see, the author did a neat job and clearly showed how the input dimension of 64x64 is downsampled at each layer.
Now if you resize your input to 128x128, and don't change anything here, you'll get a featuremap of size 8x8 instead of 4x4 in the penultimate conv layer! and  thus will face an error. You either need to use one more conv layer, or use another pooling layer to get to the correct dimensions among other ways, in order to fix this. 
The same thing applies to the generator. here the generator is given as : 
class Generator(nn.Module):
    def __init__(self, ngpu):
        super(Generator, self).__init__()
        self.ngpu = ngpu
        self.main = nn.Sequential(
            # input is Z, going into a convolution
            nn.ConvTranspose2d( nz, ngf * 8, 4, 1, 0, bias=False),
            nn.BatchNorm2d(ngf * 8),
            nn.ReLU(True),
            # state size. (ngf*8) x 4 x 4
            nn.ConvTranspose2d(ngf * 8, ngf * 4, 4, 2, 1, bias=False),
            nn.BatchNorm2d(ngf * 4),
            nn.ReLU(True),
            # state size. (ngf*4) x 8 x 8
            nn.ConvTranspose2d( ngf * 4, ngf * 2, 4, 2, 1, bias=False),
            nn.BatchNorm2d(ngf * 2),
            nn.ReLU(True),
            # state size. (ngf*2) x 16 x 16
            nn.ConvTranspose2d( ngf * 2, ngf, 4, 2, 1, bias=False),
            nn.BatchNorm2d(ngf),
            nn.ReLU(True),
            # state size. (ngf) x 32 x 32
            nn.ConvTranspose2d( ngf, nc, 4, 2, 1, bias=False),
            nn.Tanh()
            # state size. (nc) x 64 x 64
        )

    def forward(self, input):
        return self.main(input)

and as you can see again, the input latent vector is ultimately resized to a 64x64 image and thus it will cause an error when you feed this image to your Discriminator which expects a e.g. 128x128 image!  You can remedy this issue by either using another ConvTranspose2d or an upsampling layer at the very end to achieve 128x128 output.  
By the way concerning your choice of height and width, I'd highly suggest to go with a symmetric dimension(i.e. 32x32, 64x64, etc), as this will be much easier for you in downsampling and also generating the image in the generator network. 
