Fix best_model_path init if no best_mode

pull/800/head
Eren Gölge 2021-09-09 09:01:52 +00:00
parent abf5e48177
commit 2dfc5bdd11
1 changed files with 1 additions and 1 deletions

View File

@ -1146,7 +1146,7 @@ def get_last_checkpoint(path: str) -> Tuple[str, str]:
last_models["checkpoint"] = last_models["best_model"]
elif "best_model" not in last_models: # no best model
# this shouldn't happen, but let's handle it just in case
last_models["best_model"] = None
last_models["best_model"] = last_models["checkpoint"]
# finally check if last best model is more recent than checkpoint
elif last_model_nums["best_model"] > last_model_nums["checkpoint"]:
last_models["checkpoint"] = last_models["best_model"]