diff --git a/src/optimizer_interface.jl b/src/optimizer_interface.jl index f7c6a01fd21..8a623f037b8 100644 --- a/src/optimizer_interface.jl +++ b/src/optimizer_interface.jl @@ -107,7 +107,14 @@ function set_optimizer(model::Model, optimizer_constructor; else optimizer = MOI.instantiate(optimizer_constructor) end - MOIU.reset_optimizer(model, optimizer) + model.moi_backend = MOIU.CachingOptimizer( + model.moi_backend.model_cache, + optimizer, + MOIU.EMPTY_OPTIMIZER, + MOIU.AUTOMATIC, + MOIU.IndexMap(), + MOIU.IndexMap(), + ) end # Deprecation for JuMP v0.18 -> JuMP v0.19 transition