DATA_NOT_AVAILABLE error when Retrieving Solutions for Multiple Scenarios
Awaiting user inputHi,
I am using gurobi 9.5 and have a multiple-scenarios model where the constraint set among different scenarios are the same, only the objective functions are different.
I tried to call GRBoptimize() and the optimstatus returns GRB_OPTIMAL, but when I retrieved ScenNX (the solution vector), some scenarios failed and returned me DATA_NOT_AVAILABLE.
May I asked why this would fail even though the solving status is optimal?
Thank you and regards,
Yuyi
-
Hi Yuyi,
Could you provide a log snippet showing the optimization run together with the error?
Could you provide a minimal working example to reproduce the issue?
Best regards,
Jaromił0 -
Hi,
The code snippet looks like, where in the second last row, it gives me "Gurobi error: Unable to retrieve attribute 'ScenNX' with error code 10005. Error obtaining ScenNX 50 for layer 0, neuron 204", where code 1005 refers to GRB_ERROR_DATA_NOT_AVAILABLE.
error = GRBsetintparam(GRBgetenv(model), "ScenarioNumber", i);
handle_gurobi_error(error, GRBgetenv(model));
error = GRBgetdblattr(model, "ScenNObjVal", &solved_lb);
handle_gurobi_error(error, env);
error = GRBgetdblattrarray(model, "ScenNX", 0, fp->num_pixels, fp->input_val);
handle_gurobi_error(error, env);My constraint set is the approximate linear encoding of a convolutional network (shorted as C1) + a property regarding the network's output neurons (shorted as C2).
I noticed that if my constraint set is only C1, then all ScenNX retrievings are good.
But if my constraint set is C1+C2, then some scenarios fail to return ScenNX, even though all scenarios share the same set of constraint and only objective difference.
My C2 contains 3 constraints as follows, where the first element is the constant bias, and the rest 6 are coefficients of 6 output neurons respectively.
C2-1: 1.00000000, 2.77943254,-0.00000000, 0.00000001,-0.00000000, -0.00000000,-0.00000000
C2-2: -2.17545170, 1.00000000,0.99999995, -0.00000000,0.99999989, 0.99999989,0.00000001
C3-3: -2.99957194, 1.00000000,0.99999996, 0.99999985,0.99999985, -0.00000000,-0.00000000Could you please advise me why these three constraints would lead to the failure to retrieve some of the scenarios?
(Sorry that no minimal working example since it requires loading all constraints regarding the convolutional network)
Thanks and regards,
Yuyi
0 -
Hi Yuyi,
It is possible that no feasible solution point has been found for these scenarios, cf. last paragraph of Retrieving Solutions for Multiple Scenarios. Thus, it is possible that these scenarios are infeasible.
Best regards,
Jaromił0 -
Hi,
Thank you for the latest reply.
All the scenarios have the same constraint set, only different objective functions.
I am under this impression that as long as they share the same constraint set, they should be either all feasible or all infeasible.
So is this impression wrong in real-world solving cases?
Thanks and regards,
Yuyi
0 -
Hi Yuyi,
This sounds strange. Could you please share an MPS or LP file of the problematic model? If this is not possible could you please post a log snippet showing the behavior? Note that it is not possible to upload files in the Community Forum but we discuss an alternative in Posting to the Community Forum.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
5 comments