Lornatang / SRGAN-PyTorch

A simple and complete implementation of super-resolution paper.
Apache License 2.0
406 stars 105 forks source link

About Training with SRGAN #82

Open vegetableclean opened 1 year ago

vegetableclean commented 1 year ago

Hello, I am new here, I have several questions to ask. First, I follow your step to train the SRGAN model, is it really necessary to train the SRResnet for arounf 90 epochs first and then train the SRGAN model, since I am not sure if this will affect the performance of the SRGAN. Second, after following your step, I am not sure if my SRGAN loss is right. That is, my D_loss is decreasing while G_loss is increasing, and I am not understand about the meaning of this. Last, I try to improve the stability of the SRGAN and want ot try out the WGAN, is it possible to revise your code and to implement WGAN? thanks!

dinavod12 commented 1 year ago

Yes, it is necessary to pre-train the SRResnet for around 90 epochs before training the SRGAN. This is because the SRResnet is used as a generator network in the SRGAN architecture. The purpose of pre-training the SRResnet is to get a good initial set of weights that can be fine-tuned during the SRGAN training process. The SRGAN focuses on refining the results produced by the SRResnet, so starting from a pre-trained SRResnet can significantly improve the performance and convergence of the SRGAN model.

In the SRGAN model, the Generator (G) tries to generate high-resolution images, while the Discriminator (D) tries to differentiate between real high-resolution images and those generated by the generator. The G_loss increasing and D_loss decreasing during training is not unusual, and it's actually what we expect.

The Generator loss (G_loss) increasing indicates that the generator is trying to produce more realistic images and is finding it challenging to fool the discriminator. It wants the generated images to be classified as real images, which means the generator is learning. The Discriminator loss (D_loss) decreasing indicates that the discriminator is getting better at distinguishing between real and generated images, which is also a good sign.-

Subral commented 2 months ago

hey i was trying to find srgan.pb file, but couldn't find it. can you help with this

Lornatang commented 2 months ago

As described in the paper, it makes sense to pre-train the SRResNet in advance to avoid that when sent to the adversarial stage, the images generated by the generative model will be black, which will lead to falling into a local minimum and leading to training failure