From 1e9a75d232e24b32b913edb12ac7fe9ebcf35261 Mon Sep 17 00:00:00 2001 From: Chuizheng Meng Date: Mon, 23 Apr 2018 19:53:51 +0800 Subject: [PATCH] fixed the bug when testing cycle_gan model Attribute "real_A" and attribute "real_B" are not set when testing. --- models/cycle_gan_model.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/cycle_gan_model.py b/models/cycle_gan_model.py index 223dca0c4d6..0d6d09ae02a 100644 --- a/models/cycle_gan_model.py +++ b/models/cycle_gan_model.py @@ -85,12 +85,12 @@ def forward(self): self.real_B = Variable(self.input_B) def test(self): - real_A = Variable(self.input_A, volatile=True) - self.fake_B = self.netG_A(real_A) + self.real_A = Variable(self.input_A, volatile=True) + self.fake_B = self.netG_A(self.real_A) self.rec_A = self.netG_B(self.fake_B) - real_B = Variable(self.input_B, volatile=True) - self.fake_A = self.netG_B(real_B) + self.real_B = Variable(self.input_B, volatile=True) + self.fake_A = self.netG_B(self.real_B) self.rec_B = self.netG_A(self.fake_A) def backward_D_basic(self, netD, real, fake):