Skip to content

Commit

Permalink
Fix HPO crashes when optimizing for single value scalars (#1221)
Browse files Browse the repository at this point in the history
  • Loading branch information
allegroai committed Mar 17, 2024
1 parent 3531071 commit f48d9d5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions clearml/automation/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,10 @@ def _report_completed_status(self, completed_jobs, cur_completed_jobs, task_logg
if job_id in completed_jobs:
if value != completed_jobs[job_id][0]:
iteration_value = self._objective_metric.get_current_raw_objective(job_id)
iteration = [it_[0] if it_ else -1 for it_ in iteration_value]
if iteration_value:
iteration = [it_[0] if it_ else -1 for it_ in iteration_value]
else:
iteration = [-1]
completed_jobs[job_id] = (
value,
iteration,
Expand All @@ -2049,7 +2052,10 @@ def _report_completed_status(self, completed_jobs, cur_completed_jobs, task_logg
pairs.append((i, value))
labels.append(str(params)[1:-1])
iteration_value = self._objective_metric.get_current_raw_objective(job_id)
iteration = [it_[0] if it_ else -1 for it_ in iteration_value]
if iteration_value:
iteration = [it_[0] if it_ else -1 for it_ in iteration_value]
else:
iteration = [-1]
completed_jobs[job_id] = (
value,
iteration,
Expand Down

0 comments on commit f48d9d5

Please sign in to comment.