mirror of
https://github.com/clearml/clearml
synced 2025-06-23 01:55:38 +00:00
Fix Optuna optimizer failing on tasks with None value in scalar query
This commit is contained in:
parent
0d0cc642e1
commit
4d5e77f67c
@ -53,7 +53,8 @@ class OptunaObjective(object):
|
|||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
iteration_value = self.optimizer._objective_metric.get_current_raw_objective(current_job)
|
iteration_value = self.optimizer._objective_metric.get_current_raw_objective(current_job)
|
||||||
|
|
||||||
if iteration_value:
|
# make sure we skip None objective values
|
||||||
|
if iteration_value and iteration_value[1] is not None:
|
||||||
# update budget
|
# update budget
|
||||||
trial.report(value=iteration_value[1], step=iteration_value[0])
|
trial.report(value=iteration_value[1], step=iteration_value[0])
|
||||||
|
|
||||||
@ -68,6 +69,7 @@ class OptunaObjective(object):
|
|||||||
if self.max_iteration_per_job and iteration_value[0] >= self.max_iteration_per_job:
|
if self.max_iteration_per_job and iteration_value[0] >= self.max_iteration_per_job:
|
||||||
current_job.abort()
|
current_job.abort()
|
||||||
break
|
break
|
||||||
|
|
||||||
if not self.optimizer.monitor_job(current_job):
|
if not self.optimizer.monitor_job(current_job):
|
||||||
break
|
break
|
||||||
sleep(self.sleep_interval)
|
sleep(self.sleep_interval)
|
||||||
|
Loading…
Reference in New Issue
Block a user