Skip to content

Commit fa78c4f

Browse files
authored
add options to control the number of checkpoints being evaluated after training (#770)
1 parent 5861246 commit fa78c4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/train.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def parse_config():
4141

4242
parser.add_argument('--max_waiting_mins', type=int, default=0, help='max waiting minutes')
4343
parser.add_argument('--start_epoch', type=int, default=0, help='')
44+
parser.add_argument('--num_epochs_to_eval', type=int, default=0, help='number of checkpoints to be evaluated')
4445
parser.add_argument('--save_to_file', action='store_true', default=False, help='')
4546

4647
args = parser.parse_args()
@@ -186,7 +187,7 @@ def main():
186187
)
187188
eval_output_dir = output_dir / 'eval' / 'eval_with_train'
188189
eval_output_dir.mkdir(parents=True, exist_ok=True)
189-
args.start_epoch = max(args.epochs - 0, 0) # Only evaluate the last 10 epochs
190+
args.start_epoch = max(args.epochs - args.num_epochs_to_eval, 0) # Only evaluate the last args.num_epochs_to_eval epochs
190191

191192
repeat_eval_ckpt(
192193
model.module if dist_train else model,

0 commit comments

Comments
 (0)