diff --git a/train.py b/train.py index 205195e..f5a6abd 100644 --- a/train.py +++ b/train.py @@ -222,17 +222,19 @@ for epoch in range(num_epochs): time_left = datetime.timedelta(seconds=batches_left * (time.time() - prev_time)) epoch_time = time.time() - prev_time prev_time = time.time() - sys.stdout.write( - "\r[Epoch %d/%d] [Batch %d/%d] [loss: %f] ETA: %.10s" - % ( - epoch, - num_epochs, - i, - len(loader['train']), - loss.item(), - time_left, + if step % 100 == 0: + sys.stdout.write( + "\r[Epoch %d/%d] [Batch %d/%d] [loss: %f] ETA: %.10s" + % ( + epoch, + num_epochs, + i, + len(loader['train']), + loss.item(), + time_left, + ) ) - ) + # adjust the learning rate