Closed GabrielPonte closed 2 years ago
@odow can you field this one?
You need to pass a function which creates an optimizer
nl_solver = () -> MOI.Utilities.CachingOptimizer(
MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}()),
KNITRO.Optimizer(),
)
Thank you!
This issue is related to the KNITRO Issue #231. I've been trying to use KNITRO as nl_solver, but to no avail. From what I understand, it's not possible to call it directly because KNITRO doesn't support adding constraints after optimize! In the KNITRO Issue, it was suggested using caching optimizer and it worked perfectly with MOI, but can I call nl_solver using caching optimizer? I tried to do
but I received this error
The provided optimizer_constructor is invalid. It must be callable with zero arguments. For example, "Ipopt.Optimizer" or "() -> ECOS.Optimizer()". It should not be an instantiated optimizer like "Ipopt.Optimizer()" or "ECOS.Optimizer()". (Note the difference in parentheses!)
and if I try without parenthesis, I get this errorMethodError: no method matching MathOptInterface.Utilities.CachingOptimizer(::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}, ::Type{KNITRO.Optimizer})