I have simplified the deblurgan implementation into a ipynb. There you can upload your custom dataset, train, test and continue training the pretrained model.
I had encountered a lot of issues while training and some of the tips I can give are:
- Instead of using nn.BatchNorm2d, try using nn.InstanceNorm2d because of the smaller batch size
- Start training with same learning rates of disc & generator (0.0001 standard according to the paper)
- If the generator doesn't seem to improve then change the lr to 0.0002/ train the generator twice per epoch or add noise to both blurred and sharp data
- When you are using custom dataset, resize it with correct dimensions so that image doesn't distort. I have put AR code inside.
- Overfitting isn't really an issue for this model however, balancing generator and discriminator can become challenging for which play with their learning rates and training frequency.
Loss visualization(100 epochs):
Original Paper: https://arxiv.org/abs/1711.07064
Codes Borrowed from: https://github.com/KupynOrest/DeblurGAN https://github.com/The-GAN-g/DeblurGAN