We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 434bfce commit 7cda001Copy full SHA for 7cda001
train.py
@@ -65,10 +65,12 @@
65
writer.add_scalar('lr', optimizer.param_groups[0]['lr'], epoch)
66
scheduler.step(val_loss)
67
68
+ # 가장 마지막 epoch의 모델을 저장
69
+ os.makedirs('weights', exist_ok=True)
70
+ torch.save(model.state_dict(), os.path.join('weights', '{}_last.pth'.format(config['model_name'])))
71
+
72
# Best mIoU를 가진 모델을 저장
73
if miou > prev_miou:
- os.makedirs('weights', exist_ok=True)
- torch.save(model.state_dict(),
- os.path.join('weights', '{}_best.pth'.format(config['model_name'])))
74
+ torch.save(model.state_dict(), os.path.join('weights', '{}_best.pth'.format(config['model_name'])))
75
prev_miou = miou
76
writer.close()
0 commit comments