减少训练过程中的输出频率

修改了训练脚本,将训练过程中的进度输出频率从每批输出改为每100批输出一次,以减少输出量,提高训练效率。
This commit is contained in:
whaifree 2024-10-06 22:16:42 +08:00
parent 87fa4dfcc6
commit d65f6ec3ce

View File

@ -222,6 +222,7 @@ for epoch in range(num_epochs):
time_left = datetime.timedelta(seconds=batches_left * (time.time() - prev_time)) time_left = datetime.timedelta(seconds=batches_left * (time.time() - prev_time))
epoch_time = time.time() - prev_time epoch_time = time.time() - prev_time
prev_time = time.time() prev_time = time.time()
if step % 100 == 0:
sys.stdout.write( sys.stdout.write(
"\r[Epoch %d/%d] [Batch %d/%d] [loss: %f] ETA: %.10s" "\r[Epoch %d/%d] [Batch %d/%d] [loss: %f] ETA: %.10s"
% ( % (
@ -234,6 +235,7 @@ for epoch in range(num_epochs):
) )
) )
# adjust the learning rate # adjust the learning rate
scheduler1.step() scheduler1.step()