Ipopt Set Attribute

I got little issue with

model = Model(with_optimizer(Ipopt.Optimizer, tol=1e-9))
set_optimizer_attribute(model, “constr_viol_tol”, 0)
#throws this error when called optimize!

It is a valid option, but it is of type Number, not of type Integer. Please check the documentation for options.

When looking to Ipopt documentation its passing wrong type

so tried
aa = convert(Number, 10)


Is there some way how can I fix it ? :slight_smile:

Version of Julia is 1.5.3
Thanks alot :broccoli:

Using 0.0 helped :slight_smile:


Unfortunately the message coming from Ipopt isn’t very clear. But yes, you passed an integer 0 when Ipopt wanted a Float64 0.0.


I think that gracefully converting inputs is reasonable in user-facing API, perhaps open an issue at Ipopt.jl.

1 Like

Ipopt.jl passes options as given by the user. We don’t store a map of every Ipopt option name to the type, so we can’t do conversion.