mirror of
https://github.com/clearml/clearml
synced 2025-05-29 09:38:15 +00:00
Fix Optuna n_jobs deprecation warning
This commit is contained in:
parent
104308d660
commit
8a60a92fac
@ -1,3 +1,4 @@
|
|||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from typing import Any, Optional, Sequence
|
from typing import Any, Optional, Sequence
|
||||||
|
|
||||||
@ -174,8 +175,9 @@ class OptimizerOptuna(SearchStrategy):
|
|||||||
sleep_interval=int(self.pool_period_minutes * 60),
|
sleep_interval=int(self.pool_period_minutes * 60),
|
||||||
config_space=config_space,
|
config_space=config_space,
|
||||||
)
|
)
|
||||||
self._study.optimize(
|
with ThreadPoolExecutor(max_workers=self._num_concurrent_workers) as executor:
|
||||||
self._objective.objective, n_trials=self.total_max_jobs, n_jobs=self._num_concurrent_workers)
|
for _ in range(self._num_concurrent_workers):
|
||||||
|
executor.submit(self._study.optimize, self._objective.objective, n_trials=self.total_max_jobs)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
# type: () -> ()
|
# type: () -> ()
|
||||||
|
Loading…
Reference in New Issue
Block a user