Run time of C3W2: SRGAN (Optional) lab

Hi @saifkhanengr, that training IS slow, but I just gave it a try, and it was faster for me than what you’re seeing. I ran that cell for about 1 hour and it had gotten through 50000 steps - so halfway through the total, which would mean about 2 hours for the full 100000 steps, unless for some reason it started slowing way down towards the end. I was using colab.

If you were also using colab, the only thing I can think is that you somehow were using device = cpu. Maybe try changing the first line of that cell so that you break if torch.cuda.is_available() is false, just as a way to make doubly sure you’re running with gpu.

One other suggestion would be to reduce the total_steps in the call to train_srresnet to something smaller. It should be good enough for experimentation after 20K steps or so. Then you’ll at least have something to use to try out the next part - the SRGAN itself.

FYI, I noticed this old post about this optional lab. As far as I can tell, the calculations for adversarial loss still look suspicious, since both fake and real loss are checking for fake predictions to be false:

g_loss calls: self.adv_loss(fake_preds_for_g, False)
...
d_loss calls: self.adv_loss(fake_preds_for_d, False)

Just something to be aware of when you get to the SRGAN part of the lab. If your results aren’t looking great, you may want to experiment adjusting to make sure the discriminator is trying to predict false for fakes and the generator is trying to get the discriminator to predict true for fakes. (And if you do find you need to change something for this, please post back here so I can ping the developers to remind them that they still need to take a look at this.)