Skip to content

Commit

Permalink
Add checkpoint path to evaluation run name
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed Oct 29, 2024
1 parent 6b68641 commit e110eb5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion crabs/detector/evaluate_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions crabs/detector/utils/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e110eb5

Please sign in to comment.