Skip to content

optuna/direction-and-directions

Pack Severity Fix Versions
Optuna error none, edit by hand All versions

optuna.create_study raises ValueError: Specify only one of direction and directions. when both direction= and directions= are non-None.

study = optuna.create_study(direction="minimize", directions=["minimize", "maximize"])
study = optuna.create_study(directions=["minimize", "maximize"])

Calls to optuna.create_study supplying both non-None direction= and directions= keyword arguments.

Keep direction= for single-objective optimization, or directions= for multi-objective optimization.

create_study accepts either direction= for single-objective search or directions= for multi-objective search, not both. Passing both raises ValueError("Specify only one of `direction` and `directions`.").

See all rules in the Optuna pack.