-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in conditioning of discriminator? #29
Comments
You're right, sadly, the conditional models haven't really been that well documented in the papers, they're more interested in the unconditional ones and their respective datasets. Tied to this, to answer your question, all of the tests they've done are changing the values of the number of layers of the mapping network The StyleGAN2 paper basically said that everyone before them focused too much on the Discriminator, so that's why they mostly focused on the Generator. Regarding the default value, this is set in the definition of the So, if you want to test out different values for the number of mapping layers in a conditional Discriminator, then you need to add a command to do so in |
Thanks, no, huge thanks! You can see that now everything is correct:
I added a key argument --cond-D-nofix for backward compatibility, so that models that were trained before this fix, hence having wrong amount of conditioning mapping layers in discriminator, can be resumed for more training without any issue. But if i would go from the opposite, like from 2 cond. map. layers Disc. base, and try to apply --cond-D-nofix, so in the next resume the network would be forced to spawn 6 new randomly initialized mapping layers in Discriminator, no errors is also accuring, but the discoloration(increase in saturation of the images) in fakes0000.png is observable. I think not to close this issues right away, cause i want to do some minor testing, so i could share the results here. Big thanks, again, for explanations and your help👍 |
No problem, let me know how the tests go then. I'll ask l4rz and others if they have done any tests setting the number of mapping layers for a conditional Discriminator, but from what I can tell, only the mapping of the Generator has been changed and the Discriminator has been set at 8. For example, in StyleGAN2-ADA, they test this with CIFAR-10 (low res, but still a test): @pbaylies has a conditional WikiArt model and, as far as I can tell, he set the number of mapping layers in D to the default value of 8, but I'll ask just in case. Lastly, I do think that adding an argument for setting the number of mapping layers (defaulting to 8) is a better choice, and a clearer one. This will let the users know what is the default value (which many don't touch), and give the flexibility to easily change this or test with it. But this will all depend on how your results go, to see if it's worth it. |
I trained a conditional WikiArt model on StyleGAN2 using the defaults (see https://github.com/pbaylies/stylegan2-ada - I do also have other checkpoints on PyTorch that never got released I guess), and @justinpinkney trained an unconditional StyleGAN3 WikiArt model using the defaults (see https://github.com/justinpinkney/awesome-pretrained-stylegan3 for that one and a few others). Note that you should be able to do model surgery and retrain to make a checkpoint conditional, but it probably makes more sense to train from scratch if you can. Unrelated, there's also a stable diffusion WikiArt model that derives from the same dataset I had used (but with more added captions etc.), here: https://huggingface.co/valhalla/sd-wikiart-v2 |
Thanks a lot for your detailed response @DEBIHOOD! Since you already have trained two networks with different mapping layers, is it possible for you to plot the spectral analysis (via running Given that the source of frequency bias comes from the Discriminator, it'd be interesting to see how the number of mapping layers affects this. |
I'm pretty sure i wouldn't get any support in official SG3 repo, because it all looks abandoned, the issues of this repo mostly remain silently unanswered.
I noticed that you provided some community support by answering to some issues, for the users in it, i think this is important contribution for StyleGAN community, so props to you.
I think this is the only place where this problem might be unraveled, and i thought you could shred some light on it.
Recently i've tried to train conditional model, and i'm super hyped about it, because i've been playing with SG for quite a while already, and it is the first time i was trying conditional model. The power that conditioning is able to provide is just super cool to me.
Also, turned out SG supports multiple labels out of the box, which was quite unexpected for me, and i'm even more hyped to try that out.
Papers of SG/SG2/SG3 doesn't seems to have even a single word about conditioning, but the code has it.
I was trying to find something related to it in the papers, but no luck.
Describe the bug
Everything related to the bug is already described here:
NVlabs#209
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: