facebookresearch / hydra

Hydra is a framework for elegantly configuring complex applications
https://hydra.cc
MIT License
8.81k stars 635 forks source link

[Bug]OptunaSweeper sample does not work with Hydra=1.2.0 #2313

Open mrkm99 opened 2 years ago

mrkm99 commented 2 years ago

I tried OptunaSweeper following the official tutorial, but an error occurred. Site:https://hydra.cc/docs/next/plugins/optuna_sweeper/ command:python example/sphere.py --multirun 'x=interval(-5.0, 5.0)' 'y=interval(0, 10)' Error encountered

In 'config': ConfigKeyError raised while composing config:
Key 'max_failure_rate' not in 'OptunaSweeperConf'
    full_key: hydra.sweeper.max_failure_rate
    object_type=OptunaSweeperConf

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

OS:Windows10 Python:3.10.5 Library Version:

hydra-core                1.2.0
hydra-optuna-sweeper      1.2.0
Jasha10 commented 2 years ago

This should be fixed if you use the latest version of the hydra-optuna-sweeper package from pypi.

mrkm99 commented 2 years ago

Thanks Jasha10. I tried with the latest version but the error still occurs. I was able to avoid the error by removing max_failure_rate in config. If this item is not important, it should be removed from the sample conf/config.yaml.

Jasha10 commented 2 years ago

I see. Sorry about that.

praksharma commented 2 years ago

The error is still there. I was trying this example from the official repo. https://github.com/facebookresearch/hydra/blob/main/plugins/hydra_optuna_sweeper/example/sphere.py

The error is:

[s.1915438@sl2(sunbird) testing]$ python main.py 
In 'config': ConfigKeyError raised while composing config:
Key 'max_failure_rate' not in 'OptunaSweeperConf'
    full_key: hydra.sweeper.max_failure_rate
    object_type=OptunaSweeperConf

Here is my hydra versions:

[s.1915438@sl2(sunbird) testing]$ pip list | grep hydra
hydra-core                    1.2.0
hydra-optuna-sweeper          1.2.0
hydra-submitit-launcher       1.2.0
t-schanz commented 1 year ago

I still have this issue with hydra 1.3.2 . I realized that the latest stable version of the hydra-optuna-sweeper in PyPI is from May 18, 2022.

It seems to work with the dev version on PyPI:

pip install hydra-optuna-sweeper==1.3.0.dev0