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

Pymoo crashes when sequential runs have different n_obj #357

Open
schmoelder opened this issue Dec 17, 2022 · 1 comment
Open

Pymoo crashes when sequential runs have different n_obj #357

schmoelder opened this issue Dec 17, 2022 · 1 comment
Assignees
Labels

Comments

@schmoelder
Copy link

schmoelder commented Dec 17, 2022

When running several optimizations in series, Output objects are reused. This leads to incorrect values of certain indicators and in case of a different number of objectives, to a crash with the following error.

N[..., neither_nan] = (X[..., neither_nan] - xl[neither_nan]) / (xu[neither_nan] - xl[neither_nan])
IndexError: boolean index did not match indexed array along dimension 1; dimension is 3 but corresponding boolean dimension is 1

For an example, see here.

As mentoined by @blankjul on Discord, this can be fixed by explicitly instantiating a new Output object when setting up the algorithm.

from pymoo.util.display.multi import MultiObjectiveOutput
algorithm_1.setup(
    problem_1, termination=setup_termination(n_max_gen_1),
    seed=seed_1, verbose=True, save_history=False,
    output=MultiObjectiveOutput()
)
@blankjul blankjul self-assigned this Dec 21, 2022
@blankjul blankjul added the bug label Dec 21, 2022
@blankjul
Copy link
Collaborator

Thank you for documenting the issue here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants