locuslab / qpth

A fast and differentiable QP solver for PyTorch.

Home Page:https://locuslab.github.io/qpth/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in running code of end to end learning program

parimuns opened this issue · comments

Hello Bamos

In reference to your work with Priya Donti "Task-based End-to-end Model Learning
in Stochastic Optimization" [https://github.com/locuslab/e2e-model-learning.git]
I am trying to implement the battery storage code but unable to get the results.I am getting qpth error .Below attached is the code and error.

Running the main.py file in command line interface with

gives 

```iter: 0, pri_resid: 9.11662e+01, dual_resid: 1.44910e-14, mu: 7.04911e+01
iter: 1, pri_resid: 1.55261e+01, dual_resid: 3.30352e-14, mu: 1.79035e+01
iter: 2, pri_resid: 1.32344e+00, dual_resid: 3.38888e-14, mu: 2.72255e+00
iter: 3, pri_resid: 1.31702e-01, dual_resid: 3.35632e-14, mu: 4.85668e-01
iter: 4, pri_resid: nan, dual_resid: nan, mu: nan
iter: 5, pri_resid: nan, dual_resid: nan, mu: nan
iter: 6, pri_resid: nan, dual_resid: nan, mu: nan
iter: 7, pri_resid: nan, dual_resid: nan, mu: nan
iter: 8, pri_resid: nan, dual_resid: nan, mu: nan
iter: 9, pri_resid: nan, dual_resid: nan, mu: nan
iter: 10, pri_resid: nan, dual_resid: nan, mu: nan
iter: 11, pri_resid: nan, dual_resid: nan, mu: nan
iter: 12, pri_resid: nan, dual_resid: nan, mu: nan
iter: 13, pri_resid: nan, dual_resid: nan, mu: nan
iter: 14, pri_resid: nan, dual_resid: nan, mu: nan
iter: 15, pri_resid: nan, dual_resid: nan, mu: nan
iter: 16, pri_resid: nan, dual_resid: nan, mu: nan

--------
qpth warning: Returning an inaccurate and potentially incorrect solution.

Some residual is large.
Your problem may be infeasible or difficult.

You can try using the CVXPY solver to see if your problem is feasible
and you can use the verbose option to check the convergence status of
our solver while increasing the number of iterations.

Advanced users:
You can also try to enable iterative refinement in the solver:
https://github.com/locuslab/qpth/issues/6'''

Hi @parimuns, sorry about the errors here from the older code here. This primal and dual residual look okay, I think the solution being returned here may be good and you can ignore the warning here and let the experiment keep running. How do the results look when you let it keep running?

\cc @priyald17

@bamos.Thanks for replying. I didn't get any solution. I ran the main.py file for testing in command interface with only 1 run and paramset (2) and then I got the above error. I didn't get any solution.
If there is something in code or folder which I am missing , please let me know.

I

Hmm, this message should just be a warning that the solver internally hit these NaNs and I think it will return the best solution it got so that the experiment can keep running

(But I've not run this code in a while and it may be erroring out because of this or some other reason)

Okay. Is there any new update in the code? Can you pls run this code and help me in this issue. This work is really beneficial to me and will be helpful in my research work
I am trying to contact @priyald17 , but she is not replying.
Thanks a lot.

Hi @parimuns, should be able to get back to you in the next few days!

@bamos feel free to resolve this issue here, as there's already an issue open on the e2e-learning repo.

Ah yeah, let's continue the discussion in locuslab/e2e-model-learning#8 if that's related here. Also the trace there isn't because of this qpth warning