Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ix64 committed Dec 5, 2018
1 parent ae8f8df commit 5324bc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions eager_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def train(self):
except tf.errors.OutOfRangeError:
break
if real_cond.shape[0] != self.args.batch_size:
progress_bar.add(self.args.batch_size)
print("Skip one batch")
continue
result = self._train_step(b, real_image, real_cond)
Expand Down
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@
print("Running: \"" + adj_cmd + "\"")
system(adj_cmd)
elif args.mode == "condition-sample":
args.reuse = True
model = EagerTrainer(args, generator, discriminator, adjuster, None)
bar = tf.keras.utils.Progbar(args.condition_sample_batch)
for i in range(1, 1 + args.condition_sample_batch):
cond = soft(np.array([
cond = np.array([
[0., 0., 0., 0., 0., 1., 0.],
[0., 0., 0., 0., 0., 1., 1.],
[0., 0., 0., 0., 0., 0., 1.],
Expand All @@ -111,7 +112,7 @@
[1., 0., 1., 0., 1., 0., 1.],
[1., 1., 1., 0., 1., 0., 1.],
[1., 1., 1., 1., 1., 0., 1.]
])).astype(np.float32)
]).astype(np.float32)
noise = np.random.normal(size=[1, args.noise_dim])
noise = np.repeat(noise, 8, 0).astype(np.float32)
img = model.generator([noise, cond])
Expand Down

0 comments on commit 5324bc8

Please sign in to comment.