omertov / encoder4editing

Official implementation of "Designing an Encoder for StyleGAN Image Manipulation" (SIGGRAPH 2021) https://arxiv.org/abs/2102.02766
MIT License
945 stars 154 forks source link

whether the code is wrong? #89

Open tengshaofeng opened 2 years ago

tengshaofeng commented 2 years ago

Nice work you did. When I read the code carefully, I found the code in coach.py in line 402 " self.discriminator.zero_grad() r1_final_loss = self.opts.r1 / 2 r1_loss self.opts.d_reg_every + 0 * real_pred[0] r1_final_loss.backward() self.discriminator_optimizer.step() " self.discriminator.zero_grad() should be modified to self.discriminator_optimizer.zero_grad()