forked from mrq/DL-Art-School
Fix fixed_disc DataParallel issue
This commit is contained in:
parent
8dd44182e6
commit
a66fbb32b6
|
@ -364,7 +364,7 @@ class SRGANModel(BaseModel):
|
||||||
|
|
||||||
l_g_fix_disc = torch.zeros(1, requires_grad=False).squeeze()
|
l_g_fix_disc = torch.zeros(1, requires_grad=False).squeeze()
|
||||||
for fixed_disc in self.fixed_disc_nets:
|
for fixed_disc in self.fixed_disc_nets:
|
||||||
weight = fixed_disc.fdisc_weight
|
weight = fixed_disc.module.fdisc_weight
|
||||||
real_fea = fixed_disc(pix).detach()
|
real_fea = fixed_disc(pix).detach()
|
||||||
fake_fea = fixed_disc(fea_GenOut)
|
fake_fea = fixed_disc(fea_GenOut)
|
||||||
l_g_fix_disc += weight * self.cri_fea(fake_fea, real_fea)
|
l_g_fix_disc += weight * self.cri_fea(fake_fea, real_fea)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user