-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with cplex persistent : "ValueError: Cannot load a SolverResults object with bad status" #3327
Comments
@svkawtikwar - Does it happen with all models, or a specific model? |
I did another test, I am adding the details here: What I tried?
The code fails at assert_optimal_termination(result2), with the error:
However, the solver logs for the second solve command (generated from keepfiles=True) show that model was solved by cplex. I have attached the solver log. |
Turns out the exit code from CPLEX for my model is 5.
It has no check for error code 5 and there is no mechanism to output the solver status message from CPLEX. It will be helpful to add that mechanism to the CPLEXDIRECT class. |
Hello, @svkawtikwar ! Thanks for the extra information - that is very helpful. In case you haven't been tracking it (it's not horribly transparent), we are in the process of reworking the solver interfaces (see #1030). We haven't started on CPLEX yet, but I will add to the backlog for CPLEX when we start its conversion to the new interface. |
Summary
I am using the CPLEXPersistent solver interface for my problem. Here is what I do:
When I solve it again, the cplex solver log clearly shows that cplex solved the model but then I get an error saying:
ValueError: Cannot load a SolverResults object with bad status
I am very sure that the CPLEX is able to solve the model to optimality (there is no infeasibility or unboundedness or any other error).
To troubleshoot, I replace the cplex_persistent solver with gurobi_persistent and the error goes away. So it's fair to think that the issue is with the cplex_persistent plugin and not with my model.
Also, one more important thing to mention: This error doesn't appear 100% of time, I did 10 runs of my code and it was successful 6 times.
Steps to reproduce the issue
Since, this error doesn't happen all the time, I would recommend running it multiple times.
Error Message
ValueError: Cannot load a SolverResults object with bad status`
Information on your system
Pyomo version: Pyomo 6.7.3 (CPython 3.8.0 on Windows 10)
Python version: Python 3.8.0
Operating system: Windows 10
How Pyomo was installed (PyPI, conda, source): pip
Solver (if applicable): cplex_persistent (cplex version 20.1.0.0)
Additional information
This error doesn't appear 100% of time, I did 10 runs of my code and it was successful 6 times. When I replace the cplex_persistent solver with gurobi_persistent the error goes away. So it's fair to think that the issue is with the cplex_persistent solve solution load APU and not with my model.
The text was updated successfully, but these errors were encountered: