Arham_Khan:

errD_fake.backward()


When the program runs this line of code, the gradient of the network for discriminating real images is totally discarding.
Here is some code for reference:
self.pred_fake = self.netD(fake_B.detach())
self.pred_real = self.netD(real_B)
self.loss_D_fake = self.criterionGAN(self.pred_fake, False)
self.loss_D_real = self.criterionGAN (self.pred_real, True)

self.loss_D = (self.loss_D_fake + self.loss_D_real) * 0.5
self.loss_D.backward()