Skip to content

Commit

Permalink
If we call without the epoch value, we can't log to tensorboard (we h…
Browse files Browse the repository at this point in the history
…ave no absolute reference to where we are at the training process).
  • Loading branch information
exx8 committed Mar 14, 2023
1 parent 5e31e00 commit 4c7ba46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ def validate(

batch_time_m.update(time.time() - end)
end = time.time()
if should_log_to_tensorboard(args):
if should_log_to_tensorboard(args) and epoch is not None:
#by the updates
tensorboard_writer.add_scalar('val/loss', losses_m.val, epoch*last_idx+batch_idx)
tensorboard_writer.add_scalar('val/acc1', top1_m.val, epoch*last_idx+batch_idx)
Expand Down

0 comments on commit 4c7ba46

Please sign in to comment.