optuna / kurobako-py

A Python library to help implement kurobako's solvers and problems
MIT License
9 stars 7 forks source link

Fix Study._log_completed_trial call #18

Closed c-bata closed 2 years ago

c-bata commented 2 years ago

I bumped a following exception while using kurobako-py@master with optuna@master.

Traceback (most recent call last):
  File "/home/runner/work/cmaes/cmaes/benchmark/optuna_solver.py", line 153, in <module>
    runner.run()
  File "/opt/hostedtoolcache/Python/3.10.4/x[64](https://github.com/CyberAgentAILab/cmaes/runs/5986187038?check_suite_focus=true#step:13:64)/lib/python3.10/site-packages/kurobako/solver/__init__.py", line 184, in run
    while self._run_once():
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/kurobako/solver/__init__.py", line 200, in _run_once
    self._handle_tell_call(message)
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/kurobako/solver/__init__.py", line 240, in _handle_tell_call
    solver.tell(trial)
  File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/kurobako/solver/optuna.py", line 184, in tell
    self._study._log_completed_trial(trial, values)
TypeError: Study._log_completed_trial() takes 2 positional arguments but 3 were given

The parameters of Study._log_completed_trial() are changed at Optuna v3.0.0-b0 release. Please see https://github.com/optuna/optuna/commit/6a6b0ab2be211a2b3c13fe34eb083650990f5673 for details.