From 6cfa67d83167a0178f484f4f1e5a2a749150bddb Mon Sep 17 00:00:00 2001 From: James Betker Date: Thu, 16 Jul 2020 10:18:30 -0600 Subject: [PATCH] Fix featuredisc broadcast error --- codes/models/SRGAN_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/models/SRGAN_model.py b/codes/models/SRGAN_model.py index 0a1a4cf5..26f1b589 100644 --- a/codes/models/SRGAN_model.py +++ b/codes/models/SRGAN_model.py @@ -324,8 +324,8 @@ class SRGANModel(BaseModel): # Apply noise to the inputs to slow discriminator convergence. var_ref = var_ref + noise fake_H = fake_H + noise - l_d_fea_real = torch.zeros(1) - l_d_fea_fake = torch.zeros(1) + l_d_fea_real = 0 + l_d_fea_fake = 0 if self.opt['train']['gan_type'] == 'pixgan_fea': # Compute a feature loss which is added to the GAN loss computed later to guide the discriminator better. disc_fea_scale = .5