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

HEBO demo codes fail #16

Closed
abhishek-ghose opened this issue Apr 7, 2022 · 2 comments
Closed

HEBO demo codes fail #16

abhishek-ghose opened this issue Apr 7, 2022 · 2 comments

Comments

@abhishek-ghose
Copy link

Hi,

I installed the HEBO library, and tried to run the demo codes here:

  1. https://github.com/huawei-noah/HEBO/tree/master/HEBO#demo
  2. https://github.com/huawei-noah/HEBO/tree/master/HEBO#auto-tuning-via-sklearn-estimator

Both begin executing but eventually fail with the error:
TypeError: __init__() got an unexpected keyword argument 'prob_per_variable'

The complete stacktrace for the second demo code (auto-tuning sklearn estimator) is:

Iter 0, best metric: 0.398791  
Iter 1, best metric: 0.492467
Iter 2, best metric: 0.658477
Iter 3, best metric: 0.658477
Iter 4, best metric: 0.658477
Iter 5, best metric: 0.658477
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/redacted_path_1/HEBO-master/HEBO/hebo/sklearn_tuner.py", line 74, in sklearn_tuner
    rec     = opt.suggest()
  File "/redacted_path_1/HEBO-master/HEBO/hebo/optimizers/hebo.py", line 153, in suggest
    rec = opt.optimize(initial_suggest = best_x, fix_input = fix_input).drop_duplicates()
  File "/redacted_path_1/HEBO-master/HEBO/hebo/acq_optimizers/evolution_optimizer.py", line 126, in optimize
    algo      = get_algorithm(self.es, pop_size = self.pop, sampling = init_pop, mutation = mutation, crossover = crossover, repair = self.repair)
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/factory.py", line 85, in get_algorithm
    return get_from_list(get_algorithm_options(), name, args, {**d, **kwargs})
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/factory.py", line 49, in get_algorithm_options
    from pymoo.algorithms.moo.ctaea import CTAEA
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/algorithms/moo/ctaea.py", line 223, in <module>
    class CTAEA(GeneticAlgorithm):
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/algorithms/moo/ctaea.py", line 230, in CTAEA
    mutation=PM(eta=20, prob_per_variable=None),
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/operators/mutation/pm.py", line 77, in __init__
    super().__init__(prob=prob, **kwargs)
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/core/mutation.py", line 29, in __init__
    super().__init__(**kwargs)
  File "/redacted_path_2/anaconda3/lib/python3.7/site-packages/pymoo-0.6.0.dev0-py3.7-linux-x86_64.egg/pymoo/core/mutation.py", line 10, in __init__
    super().__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'prob_per_variable'

Can you provide pointers for fixing this? Thanks!

@Alaya-in-Matrix
Copy link
Collaborator

Alaya-in-Matrix commented Apr 8, 2022

It looks like it's because you installed pymoo-0.6.0 which is currently a pre-release version, while hebo was tested under pymoo-0.5.0, could you please test the demo under pymoo-0.5.0?

Given that pymoo-0.6.0 is currently just a pre-release, I won't update HEBO to be compatible with pymoo-0.6.0, but I'll do that once 0.6.0 becomes a stable release

@abhishek-ghose
Copy link
Author

abhishek-ghose commented Apr 8, 2022

That seems to fix the issue, thank you!

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

No branches or pull requests

2 participants