summaryrefslogtreecommitdiff
path: root/src/training/run_experiment.py
diff options
context:
space:
mode:
authoraktersnurra <gustaf.rydholm@gmail.com>2021-01-24 22:14:17 +0100
committeraktersnurra <gustaf.rydholm@gmail.com>2021-01-24 22:14:17 +0100
commit4a54d7e690897dd6e6c719fb908fd371a44c2952 (patch)
tree04722ac94b9c3960baa5db7939d7ef01dbf535a6 /src/training/run_experiment.py
parentd691b548cd0b6fc4ea184d64261f633789fee021 (diff)
Many updates, cool stuff on the way.
Diffstat (limited to 'src/training/run_experiment.py')
-rw-r--r--src/training/run_experiment.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/training/run_experiment.py b/src/training/run_experiment.py
index 2c9a196..faafea6 100644
--- a/src/training/run_experiment.py
+++ b/src/training/run_experiment.py
@@ -296,7 +296,12 @@ def run_experiment(
# Run inference over test set.
if test:
logger.info("Loading checkpoint with the best weights.")
- model.load_from_checkpoint(model_dir / "best.pt")
+ if "checkpoint" in experiment_config["train_args"]:
+ model.load_from_checkpoint(
+ model_dir / experiment_config["train_args"]["checkpoint"]
+ )
+ else:
+ model.load_from_checkpoint(model_dir / "best.pt")
logger.info("Running inference on test set.")
if experiment_config["criterion"]["type"] == "EmbeddingLoss":