Look for checkpoints from previous eval training runs.
@@ -190,6 +190,13 @@ def main(cl_arguments):
if not args.load_eval_checkpoint == "none":
log.info("Loading existing model from %s...", args.load_eval_checkpoint)
load_model_state(model, args.load_eval_checkpoint, args.cuda, args.skip_task_models)
+ else:
+ # Look for eval checkpoints (available only if we're restoring from a run that already
+ # finished), then look for training checkpoints.
+ eval_best = glob.glob(os.path.join(args.run_dir,
+ "model_state_eval_best.th"))
+ if len(eval_best) > 0:
+ load_model_state(model, eval_best[0], args.cuda, args.skip_task_models)
else:
macro_best = glob.glob(os.path.join(args.run_dir,
"model_state_main_epoch_*.best_macro.th"))
