Skip to content

ValueError: The requested array has an inhomogeneous shape after 1 dimensions #6

Description

@KashyapCKotak

When passing the below bounds to Optimizer and then running it via optimizer.run...

bounds=[(-1.0, 1.0), (-3, -1, 1, 2)]
(here first dimension is real and signifies a range, while the second dimension in categorical)

I get the below error:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

This error originates in the _check_bounds method on bounds = np.asarray(bounds) line.

As per the docs:

A more elaborate example, minimizing an objective function of three variables: one integral, one real, and one nominal variable.

bounds = [
(0, 100), # From zero to at most roses per day
(.5, 9.), # Price per rose sold
(10, 20, 100), # Advertising budget
]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions