Lornatang / SRGAN-PyTorch

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

D(SR) = 0 and D(HR) = 1 #46

Closed valentin-fngr closed 2 years ago

valentin-fngr commented 2 years ago

Hi,

I have been training the SRGAN model from the repo and I have got the following losses :

image

I do not understand why D(SR) = 0 over the epochs and D(HR) = 1. The dataset that I used is the ImageNet dataset provided in the readme. Is the generator unable to trick the discriminator ?

Thank you very much

Lornatang commented 2 years ago

This is also the case for me during training, usually a common problem when training original GANs.

valentin-fngr commented 2 years ago

Should I still expect some good results ? Or do I need to investigate on how to fix it ?

Lornatang commented 2 years ago

You need to wait patiently for the training results and choose the best one.

valentin-fngr commented 2 years ago

Thank you very much, I now better understand GANs evaluation. Beautiful work on this repo

Lornatang commented 2 years ago

Thank you.

rhtm02 commented 2 years ago

Are you saying that you are learning several times to find the optimal model or that you are learning to the end and finding the optimal model among them?

valentin-fngr commented 2 years ago

I think he meant wait till the end of the training process. Surprisingly, your model can perform badly during a lot of iterations and then, suddenly, you will see the D(SR) increase and the D(HR) decrease, which is what you want. You just need to be patient due to the instability of GAN training :(

Lornatang commented 2 years ago

Currently I am trying to improve the training of SRGAN to make it more stable

Lornatang commented 2 years ago

From the current point of view, the training of GAN still has the problem of "model collapse", and it may be necessary to find the best model from the training node of GAN

rhtm02 commented 2 years ago

Ok thx a lot

valentin-fngr commented 2 years ago

Currently I am trying to improve the training of SRGAN to make it more stable

How many iterations do you use to train your model ? I would be interested in knowing what approaches you are going to use to make the training more stable as I am really interested in the subject

Lornatang commented 2 years ago

For example these methods WassersteinGAN WassersteinGAN_GP

Lornatang commented 2 years ago

I will not update on this library though, as this library is the closest implementation to the original paper