Skip to content

Commit

Permalink
Fix test when batch_size != 1
Browse files Browse the repository at this point in the history
  • Loading branch information
yenchenlin committed Dec 4, 2016
1 parent da64993 commit 3e348f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ def test(self, args):
else:
sample_images = np.array(sample).astype(np.float32)

sample_images = [sample_images[i:i+self.batch_size]
for i in xrange(0, len(sample_images), self.batch_size)]
sample_images = np.array(sample_images)
print sample_images.shape

start_time = time.time()
if self.load(self.checkpoint_dir):
print(" [*] Load SUCCESS")
Expand All @@ -409,7 +414,7 @@ def test(self, args):
print "sampling image ", idx
samples = self.sess.run(
self.fake_B_sample,
feed_dict={self.real_data: [sample_image]}
feed_dict={self.real_data: sample_image}
)
save_images(samples, [1, 1],
save_images(samples, [self.batch_size, 1],
'./{}/test_{:04d}.png'.format(args.test_dir, idx))

0 comments on commit 3e348f0

Please sign in to comment.