-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Very confused by the discriminator loss #93
Comments
A lot of people seems to have the same problem with the discriminator not being trained properly. |
Emm Yeah!
The
|
Hi, How is your results now? Could you please share your learning from tuning the Thx |
@MaxyLee congratulations! could you show more setting details? how many examples of your CUB dataset, and how many steps are in one epoch? Exactly, how many epochs do you start the discriminator? |
Here is my config: model:
base_learning_rate: 4.5e-6
target: taming.models.vqgan.VQModel
params:
embed_dim: 256
n_embed: 1024
ddconfig:
double_z: False
z_channels: 256
resolution: 256
in_channels: 3
out_ch: 3
ch: 128
ch_mult: [ 1,1,2,2,4] # num_down = len(ch_mult)-1
num_res_blocks: 2
attn_resolutions: [16]
dropout: 0.0
lossconfig:
target: taming.modules.losses.vqperceptual.VQLPIPSWithDiscriminator
params:
disc_conditional: False
disc_in_channels: 3
disc_start: 50000
disc_weight: 0.2
codebook_weight: 1.0
data:
target: main.DataModuleFromConfig
params:
batch_size: 5
num_workers: 8
train:
target: taming.data.custom.CustomTrain
params:
training_images_list_file: /data/share/data/birds/CUB_200_2011/cub_train.txt
size: 256
validation:
target: taming.data.custom.CustomTest
params:
test_images_list_file: /data/share/data/birds/CUB_200_2011/cub_test.txt
size: 256 I trained this model on CUB train split(8,855 images) using 4 GPUs with approximately 400 steps per epoch. The discriminator therefore started at more than 100 epochs. |
@MaxyLee thank u very much!!! |
Hi @MaxyLee, I have trained the vqgan with your setting on my own dataset, the discriminator startes at about 100 epochs, and disc_weight is 0.2. However I still faced the problem, the generated quality was alright. But after starting discriminator, it became worse. This is my training curve. In fact the generated images are alright without discriminator. In your traning process, do your generated images become much better after gan training? |
Yes, my model performed much better when the discriminator loss was introduced. As shown in the figure, my model could not generate fine-grained images without the discriminator. |
@MaxyLee thank you for your patience and kindness! I will try more experiments. |
I think for a successful discriminator training, logits fake should be negative and logits real should be positive. But I noticed that in the abrove train curves, logits fake and logits real looks always same. Does that mean discriminator is failed and just output same value regardless of input image? @MaxyLee would you also share your training curves of logits? |
|
Thanks very much, that confirm my suspicions: a good discriminator is enough for sharp images, no need for gan equilibrium |
Hi, How to solve the problem of logits_real and logits_fake being almost the same? |
When training the VQGAN pipeline in FFHQ dataset.
I checked the
disc_loss
use the function likevanilla_d_loss
But the metric in tensorboard ,the loss is very strangeness!
I am confused whether this discriminator loss is really optimized for generator training.
The discriminator loss is joined to the process after the training step reaches 30K. By the way, add the metric of discriminator loss form training starts to the shown in the picture above.
The text was updated successfully, but these errors were encountered: