ERROR: type DataType has no field optimizer_constructor

Hi everyone,
I’m having a problem with JuMP/Juniper.

For first I create an optimization model

    m = Model(Juniper.Optimizer)
    set_optimizer_attribute(m, "nl_solver", Ipopt.Optimizer)
    set_optimizer_attribute(m, "mip_solver", Cbc.Optimizer)

and then I define all the variables and constraints. Up to this point everithing is ok.
Successively, I run the optimization. The solver starts to print its outputs in the REPL until it ends, since the convergence is reached.

EXIT: Optimal Solution Found.
Status of relaxation: LOCALLY_SOLVED

However, immediatly after that, the following error appears:

ERROR: type DataType has no field optimizer_constructor
Stacktrace:
 [1] getproperty(::Type{T} where T, ::Symbol) at .\Base.jl:28
 [2] generate_mip(::Juniper.Optimizer, ::Juniper.JuniperProblem, ::Array{Float64,1}, ::Juniper.TabuList, ::Float64) at C:\Users\user1\.julia\packages\Juniper\Hm6I1\src\fpump.jl:9
 [3] fpump(::Juniper.Optimizer, ::Juniper.JuniperProblem) at C:\Users\user1\.julia\packages\Juniper\Hm6I1\src\fpump.jl:360
 [4] optimize!(::Juniper.Optimizer) at C:\Users\user1\.julia\packages\Juniper\Hm6I1\src\MOI_wrapper\MOI_wrapper.jl:413
 [5] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{Juniper.Optimizer}) at C:\Users\user1\.julia\packages\MathOptInterface\bygN7\src\Bridges\bridge_optimizer.jl:239
 [6] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at C:\Users\user1\.julia\packages\MathOptInterface\bygN7\src\Utilities\cachingoptimizer.jl:189
 [7] optimize!(::Model, ::Nothing; bridge_constraints::Bool, ignore_optimize_hook::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\user1\.julia\packages\JuMP\YXK4e\src\optimizer_interface.jl:131
 [8] optimize! at C:\Users\user1\.julia\packages\JuMP\YXK4e\src\optimizer_interface.jl:107 [inlined] (repeats 2 times)
 [9] top-level scope at none:0

and the optimization results are not provided.
Unfortunately, I have no idea what it means and looking on the web I did not find anything useful.
Does anyone know what is going wrong?

This error is a bit of mystery to me. You might try something like,

set_optimizer_attribute(m, "mip_solver", optimizer_with_attributes(Cbc.Optimizer, "logLevel" => 0))

That is how we test the solver. Note that the MIP solver is only used in the feasibility pump, so you can also try omitting it entierly.

@Wikunia, do you have any other suggestions?

That’s indeed interesting. I think we never tested it that way as we weren’t interested in the long output of the subsolvers. I hope the suggestion by @ccoffrin works for you.
I’m currently on vacation but I can have a look into it next week. Maybe open an issue on our repo such that I don’t forget it.

Thank you very much @ccoffrin and @Wikunia!
I suppressed the solvers output by writing

optmod = Model(with_optimizer(Juniper.Optimizer;
                nl_solver = with_optimizer(Ipopt.Optimizer, print_level = 0),
                mip_solver = with_optimizer(Cbc.Optimizer, logLevel = 0)))

and the solver ran properly.

As you suggested, I opened an issue on the Juniper repository.

Thank you again for your support!

1 Like