Skip to content

Commit

Permalink
add options to control the number of checkpoints being evaluated afte…
Browse files Browse the repository at this point in the history
…r training (open-mmlab#770)
  • Loading branch information
djiajunustc authored Jan 23, 2022
1 parent 5861246 commit fa78c4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def parse_config():

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

args = parser.parse_args()
Expand Down Expand Up @@ -186,7 +187,7 @@ def main():
)
eval_output_dir = output_dir / 'eval' / 'eval_with_train'
eval_output_dir.mkdir(parents=True, exist_ok=True)
args.start_epoch = max(args.epochs - 0, 0) # Only evaluate the last 10 epochs
args.start_epoch = max(args.epochs - args.num_epochs_to_eval, 0) # Only evaluate the last args.num_epochs_to_eval epochs

repeat_eval_ckpt(
model.module if dist_train else model,
Expand Down

0 comments on commit fa78c4f

Please sign in to comment.