The formula to calculate the output shape is given in the docs 17 of nn.ConvTranspose2d.
You could calculate the approx. architecture manually (e.g. start with layers, which would double the spatial size) and “fine-tune” the layers later in case the final output size doesn’t match.
Note that you can add print statements into the forward method of your model to get the output shapes of intermediate tensors, which would make creating the model a bit easier.