Wrong result
Yurains opened this issue · comments
Thank you for your outstanding work
I am training my own model using StyleGAN2 ada pytorch and importing other photos with PTI
but I encountered an "AssertionError: Wrong size for dimension 1: got 18, expected 12" issue
This seems to be a dimension-related problem, but I'm not sure how to resolve it
Is there a way to make the necessary changes?
Since I haven't used PTI, I can tell you where that error comes from and how to find where the code fails: in StyleGAN1/2, the mapping network G.mapping
will take a random latent z
(w
(w = G.mapping(z, None)
. The disentangled latent w
is the one you wish to find to do the editing with DragGAN (using either simple inversion or PTI), whose dimension
Concretely, StyleGAN expects two sections of the disentangled latent per block resolution in the synthesis network G.synthesis
(which starts from 4
and goes up by powers of 2 up until your final output resolution; more info in the StyelGAN architecture). So, from the AssertionError
you posted above, it seems like PTI is giving you a disentangled latent of shape [1, 18, 512]
whereas the network you are training is expecting a disentangled latent of shape [1, 12, 512]
. In other words, PTI has hard-coded an image resolution of 1024
(128
(
I could be wrong and be the other way, so it's always helpful to tell us which code you ran and which line gave the AssertionError
above, otherwise all we can do is guess.
@PDillis
Sorry for replying to you now. Thank you very much for your reply.
I tried to combine PTI with DranGAN and determined the default model he wanted to use.
This is the official default model, there is no problem.
Here I make sure my dimensions are correct and use the specified [1,18,512], but this error still occurs