Closed rut00 closed 2 years ago
What images does your generator output?
This could be that you tried defining a Generator
object with an output resolution of 1024 but you're checkpoint holds the weights of a generator with an output resolution of 512.
The error occurs in the following line:
https://github.com/yuval-alaluf/stylegan3-editing/blob/ab01a5d90b8ba67e0da0e1388f0931482601006c/inversion/models/psp3.py#L42
If the problem is with the output resolution of the generator, then you can make the following changes:
In the definition of the SG3Generator
, we can specify the output resolution with res
.
https://github.com/yuval-alaluf/stylegan3-editing/blob/ab01a5d90b8ba67e0da0e1388f0931482601006c/models/stylegan3/model.py#L19-L21
Therefore, it can simply change line 42 in psp3.py
to:
self.decoder = SG3Generator(checkpoint_path=self.opts.stylegan_weights, res=512).decoder
If this does not solve your problem, it could be because by default we use the r
config and you trained your model on the t
config. In that case, you can try specifying config=landscape
when defining your SG3Generator
. The landscape
generator also uses the t
config so this should match your generator.
Hope this helps.
With the above methods, the issue got resolved. Thank you for the help.
We are preparing our Restyle_psp_encoder with the custom dataset.
We have trained our StyleGAN3 network of type StyleGAN3-T (translation equiv.) and then converted the generated .pkl file to a .pt file using the snippet provided here: #16 (issue comment)
And after running the train_restyle_psp.py with the below command:
I am getting the below-mentioned error:
I appreciate your help. Thank you.