facebookresearch / nevergrad

A Python toolbox for performing gradient-free optimization
https://facebookresearch.github.io/nevergrad/
MIT License
3.92k stars 352 forks source link

Doesn't work with bayes-optim 0.2.6 #1447

Closed Stepets closed 11 months ago

Stepets commented 2 years ago

Steps to reproduce

install latest nevergrad, bayes-optim

  pip3 install nevergrad
  pip3 install bayes-optim

Observed Results

Traceback (most recent call last):
  File "/home/user/projects/advbiz-docker/scripts/optimiser/nevergrad/run_all.py", line 43, in <module>
    test("BayesOptimBO", 2)
  File "/home/user/projects/advbiz-docker/scripts/optimiser/nevergrad/run_all.py", line 18, in test
    optimizer = ng.optimizers.registry[opt](parametrization=instrum, budget=100, num_workers=1)
  File "/home/user/.local/lib/python3.10/site-packages/nevergrad/optimization/base.py", line 771, in __call__
    run = self._OptimizerClass(parametrization=parametrization, budget=budget, num_workers=num_workers, **config)  # type: ignore
  File "/home/user/.local/lib/python3.10/site-packages/nevergrad/optimization/optimizerlib.py", line 1951, in __init__
    model = GaussianProcess(thetaL=thetaL, thetaU=thetaU)  # create the GPR model
TypeError: GaussianProcess.__init__() got an unexpected keyword argument 'thetaL'

Expected Results

No error

Relevant Code

  instrum = ng.p.Instrumentation(ng.p.Array(shape=(2,), lower=-50, upper=50))
  ng.optimizers.registry["BayesOptimBO"](parametrization=instrum, budget=100, num_workers=1)

Bayes-optim has changed API https://github.com/wangronin/Bayesian-Optimization/blob/94af6af6f12cc013a884a8e309e1e089c3cd7481/bayes_optim/surrogate/gaussian_process/__init__.py#L31 So I had to downgrade to 0.2.5.5 version for optimization to work

teytaud commented 11 months ago

This is fixed in Nevergrad 0.12.0, we can work with the latest, namely 0.3.0. Thanks for pointing out this.