diff --git a/crabs/detector/evaluate_model.py b/crabs/detector/evaluate_model.py index c8cb032b..32d2821b 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 b24a113a..2937f05b 100644 --- a/crabs/detector/utils/evaluate.py +++ b/crabs/detector/utils/evaluate.py @@ -258,13 +258,21 @@ 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