Unable to use set_attribute


My julia version is 1.8.5. I tried to run the Benders Decomposition example from

However, issues occured with the Callback Method. Specifically with this line:

set_attribute(lazy_model, MOI.LazyConstraintCallback(), my_callback)

I’m getting “UndefVarError: set_attribute not defined”.

I went ahead and did some searching, then also tried using “set_optimizer_attribute”, but still got the error “LoadError: MathOptInterface.UnsupportedAttribute{MathOptInterface.RawOptimizerAttribute}: Attribute MathOptInterface.RawOptimizerAttribute(”(MOI.LazyConstraintCallback())“) is not supported by the model.”

What’s the cause? Any help is appreciated. Thank you.

1 Like

set_attribute was introduced in JuMP v1.9.0.

You can change the documentation to match your installed version of JuMP using the box in the bottom left:

Update you packages, otherwise, here’s the link you probably need: Benders decomposition · JuMP