ARPACK error 3 while solving the quadratic program using OSQP

968 views
Skip to first unread message

Sandeep Parameshwara

unread,
Jun 20, 2021, 6:20:56 AM6/20/21
to cvxpy
Hello,

I am solving a QP using OSQP solver. The QP is solved at a particular time instance, but I get this error immediately

Traceback (most recent call last): File "C:\Users\SPA18\Anaconda3\lib\site-packages\cvxpy\expressions\constants\constant.py", line 243, in extremal_eig_near_ref ev = SA_eigsh(sigma)

File "C:\Users\SPA18\Anaconda3\lib\site-packages\cvxpy\expressions\constants\constant.py", line 238, in SA_eigsh return eigsh(A, k=1, sigma=sigma, return_eigenvectors=False)

File "C:\Users\SPA18\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 1687, in eigsh params.iterate() File "C:\Users\SPA18\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 573, in iterate raise ArpackError(self.info, infodict=self.iterate_infodict) scipy.sparse.linalg.eigen.arpack.arpack.ArpackError: ARPACK error 3: No shifts could be applied during a cycle of the Implicitly restarted Arnoldi iteration. One possibility is to increase the size of NCV relative to NEV. During handling of the above exception, another exception occurred:

.....

File "C:\Users\SPA18\Anaconda3\lib\site-packages\cvxpy\expressions\constants\constant.py", line 238, in SA_eigsh return eigsh(A, k=1, sigma=sigma, return_eigenvectors=False) File "C:\Users\SPA18\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 1687, in eigsh params.iterate()

File "C:\Users\SPA18\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py", line 573, in iterate raise ArpackError(self.info, infodict=self.iterate_infodict) scipy.sparse.linalg.eigen.arpack.arpack.ArpackError: ARPACK error 3: No shifts could be applied during a cycle of the Implicitly restarted Arnoldi iteration. One possibility is to increase the size of NCV relative to NEV


I am getting this error quite often. Looks like the problem is originating by cvxpy problem setup. There are few questions about this on stack exchange but no clear solution. What should I change to solve this? Until the point it fails, the simulation runs quite smooth without any abrupt changes in optimal value. After that, it suddenly fails. My problem setup looks like this:

problem = cp.Problem(cp.Minimize(cost),constraints)        problem.solve(verbose=False,solver='OSQP',eps_abs=1e-4eps_rel=1e-4,)

Any help is appreciated
  • OS: Windows 10
  • OSQP v0.6.2
  • CVXPY Version: 1.1.7
Thank you

Erling D. Andersen

unread,
Jun 29, 2021, 7:30:26 AM6/29/21
to cvxpy
I know Mosek does not use ARPACK so you can use that instead of QSQP as a workaround.

Michal Adamaszek

unread,
Jul 9, 2021, 8:04:15 AM7/9/21
to cvxpy
That was previously reported in https://stackoverflow.com/questions/63960214/cvxpy-failing-randomly-on-basic-quadratic-problem#comment113142851_63960214

Seemed to me to be an issue deep in scipy. I think someone with enough time on their hands could report it there.

Reply all
Reply to author
Forward
0 new messages