Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Study._log_completed_trial call #18

Merged
merged 3 commits into from
Apr 12, 2022

Conversation

c-bata
Copy link
Member

@c-bata c-bata commented Apr 12, 2022

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 optuna/optuna@6a6b0ab for details.

setup.py Outdated Show resolved Hide resolved
Copy link
Member

@sile sile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I think that it might be better to define the logging logic within kurobako-py in the future to stop using Optuna's private methods. However, anyway, this PR itself seems nice!

@sile sile merged commit 504a014 into optuna:master Apr 12, 2022
@c-bata c-bata deleted the fix-log-completed-trials branch April 12, 2022 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants