Skip to content

Commit 9cbc850

Browse files
nmjohncopybara-github
authored andcommitted
Correctly print step number during training due to back to back train steps.
PiperOrigin-RevId: 318564215 Change-Id: I92a95386036d2e73bd90cbc309becdc606ac45a6
1 parent a18d360 commit 9cbc850

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

models/hific/train.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ def train(config_name, ckpt_dir, num_steps: int, auto_encoder_ckpt_dir,
6262
break
6363
global_step_np, _ = sess.run([global_step, train_op])
6464
global_step_np, _ = sess.run([global_step, train_op])
65-
if global_step_np == 0:
65+
# We do back to back training steps. If this is intended, we need to
66+
# log first step at 1, otherwise revert to 0.
67+
if global_step_np == 1:
6668
tf.logging.info('First iteration passed.')
67-
if global_step_np > 0 and global_step_np % 100 == 0:
69+
if global_step_np > 1 and global_step_np % 100 == 1:
6870
tf.logging.info(f'Iteration {global_step_np}')
6971
tf.logging.info('Training session closed.')
7072

0 commit comments

Comments
 (0)