Skip to content

Commit

Permalink
fixed the bug when testing cycle_gan model
Browse files Browse the repository at this point in the history
Attribute "real_A" and attribute "real_B" are not set when testing.
  • Loading branch information
mengcz13 authored Apr 23, 2018
1 parent e0a2ce8 commit 1e9a75d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models/cycle_gan_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1e9a75d

Please sign in to comment.