mirror of
https://github.com/clearml/clearml
synced 2025-01-31 17:17:00 +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 typing import Any, Optional, Sequence
|
||||
|
||||
@ -174,8 +175,9 @@ class OptimizerOptuna(SearchStrategy):
|
||||
sleep_interval=int(self.pool_period_minutes * 60),
|
||||
config_space=config_space,
|
||||
)
|
||||
self._study.optimize(
|
||||
self._objective.objective, n_trials=self.total_max_jobs, n_jobs=self._num_concurrent_workers)
|
||||
with ThreadPoolExecutor(max_workers=self._num_concurrent_workers) as executor:
|
||||
for _ in range(self._num_concurrent_workers):
|
||||
executor.submit(self._study.optimize, self._objective.objective, n_trials=self.total_max_jobs)
|
||||
|
||||
def stop(self):
|
||||
# type: () -> ()
|
||||
|
Loading…
Reference in New Issue
Block a user