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

AutoSampler, error when switching to CMAES sampler #194

Open
rodrigoscoelho opened this issue Dec 2, 2024 · 7 comments
Open

AutoSampler, error when switching to CMAES sampler #194

rodrigoscoelho opened this issue Dec 2, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@rodrigoscoelho
Copy link

Expected behavior

When using AutoSampler, it starts as expected with the first 250 trials, and, when trying to switch to CMAES sampler, as expected when the numer of trials > 250, it returns:
ERROR - Error in _suggest_params: No compatible source_trials

Environment

  • The package of OptunaHub which you are using:
  • Optuna version: 4.1
  • OptunaHub version:
  • Python version:
  • OS:
  • (Optional) Other libraries and their versions:

Error messages, stack traces, or logs

ERROR - Error in _suggest_params: No compatible source_trials

Steps to reproduce

  1. Run a optimization using autosampler. single objective, no constraints func.
  2. wait until trial 250

Additional context (optional)

No response

@rodrigoscoelho rodrigoscoelho added the bug Something isn't working label Dec 2, 2024
@nabenabe0928
Copy link
Contributor

@rodrigoscoelho
Thank you for reporting this issue!
Could you possibly give me the following?

  1. Versions: cmaes
  2. The code you used

@nabenabe0928
Copy link
Contributor

nabenabe0928 commented Dec 2, 2024

The following code did not reproduce your issue.

import optuna
import optunahub


def objective(trial: optuna.Trial) -> float:
    x = trial.suggest_float("x", -5, 5)
    y = trial.suggest_float("y", -5, 5)
    return x**2 + y**2


sampler = optunahub.load_module("samplers/auto_sampler").AutoSampler()
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=300)
optuna==4.1.0
optunahub==0.1.0
cmaes==0.11.1

@rodrigoscoelho
Copy link
Author

rodrigoscoelho commented Dec 2, 2024 via email

@nabenabe0928
Copy link
Contributor

Then could you, @rodrigoscoelho, please tell me the distribution given to ask and the search_space in the objective?

@rodrigoscoelho
Copy link
Author

rodrigoscoelho commented Dec 2, 2024 via email

@rodrigoscoelho
Copy link
Author

image
Here goes the image

@nabenabe0928
Copy link
Contributor

@rodrigoscoelho

I suspect the search space you feeded via ask method was incompatible.
Could you give me a simpler code that reproduces your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants