From 65d2ef0175a166df3375debdfeb5f17b7d2d5ca9 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:52:06 +0100 Subject: [PATCH] Add checkpoint path to evaluation run name --- crabs/detector/evaluate_model.py | 4 +++- crabs/detector/utils/evaluate.py | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crabs/detector/evaluate_model.py b/crabs/detector/evaluate_model.py index 56a50db5..0721ffa2 100644 --- a/crabs/detector/evaluate_model.py +++ b/crabs/detector/evaluate_model.py @@ -91,7 +91,9 @@ def setup_trainer(self): """Set up trainer object with logging for testing.""" # Assign run name self.run_name = get_mlflow_run_name_from_ckpt( - self.args.mlflow_run_name_auto, self.trained_model_run_name + mlflow_run_name_auto=self.args.mlflow_run_name_auto, + trained_model_run_name=self.trained_model_run_name, + trained_model_path=self.trained_model_path, ) # Setup logger diff --git a/crabs/detector/utils/evaluate.py b/crabs/detector/utils/evaluate.py index 24adf3a4..426be155 100644 --- a/crabs/detector/utils/evaluate.py +++ b/crabs/detector/utils/evaluate.py @@ -262,12 +262,20 @@ def get_mlflow_experiment_name_from_ckpt( def get_mlflow_run_name_from_ckpt( - mlflow_run_name_auto: bool, trained_model_run_name: str + mlflow_run_name_auto: bool, + trained_model_run_name: str, + trained_model_path: str, ) -> str: # ---- should be unique """Define run name for eval job from the trained model job.""" if mlflow_run_name_auto: run_name = set_mlflow_run_name() else: - run_name = trained_model_run_name + "_eval_" + set_mlflow_run_name() + run_name = ( + trained_model_run_name + + "_" + + Path(trained_model_path).stem + + "_eval" + + set_mlflow_run_name().replace("run", "") + ) return run_name