Closed jhawgs closed 3 years ago
Image size is not set by the parameter, the size is imposed by the used generator and the discriminators. So if you'd like to increase image size, you need to subclass the generator and discriminators and pass them to the input. In this case it will involve adding another ConvTranspose2d block, but better results can be achieved if more recent architectures are used.
I have been working with the model, and I am trying to generate images of size 128x128. I changed the
--image_size
option to 128. For reference, here is the full command.The initial output is the following, which verifies that the option was acknowledged by the program.
The program then runs, but doesn't produce images of size 128x128 and continues to create images of size 64x64. Additionally, saved models show no increase in size, contrary to the expected increase in response to a larger output size. I have traced the bug to the model definitions, specifically the following lines.
Note: this is only the generator definition. I would expect that each of the discriminators would also need a change analogous to what might help here.
I have tried several different resolution methods including changing n_channels, but to no avail. I just can't seem to find the point from which the arbitrary size of 64x64 originates. That does exclude that 64 is the product of 8, 4, 2, and 1, which are the coefficients of
ngf
in each output size, but I don't see how that affects the final output size ofn_channels
.Although I would love to see a fix, if anybody knows where 64x64 comes from, I can do more poking, and probably find a solution myself.