Skip to content

Commit

Permalink
update lr_scheduler and record train/val information.
Browse files Browse the repository at this point in the history
  • Loading branch information
wz committed Sep 17, 2021
1 parent 3a816a9 commit dcc00a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_segmentation/fcn/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def main(args):
with open(results_file, "a") as f:
# 记录每个epoch对应的train_loss、lr以及验证集指标
train_info = f"[epoch: {epoch}] \ntrain_loss: {mean_loss:.4f} \nlr: {lr:.6f}\n"
f.write(train_info + val_info + "\n")
f.write(train_info + val_info + "\n\n")

save_file = {"model": model.state_dict(),
"optimizer": optimizer.state_dict(),
Expand Down

0 comments on commit dcc00a4

Please sign in to comment.