Skip to content

AttributeError: module 'torch.linalg' has no attribute 'lu_factor' #57

@yufei0726

Description

@yufei0726

I encountered this problem when calling QPfunction when building an autonomous driving path tracking problem, but I printed and saw that the eigenvalues ​​of the Q matrix were all positive and there were no diagonal zero elements. I hope someone can answer this question
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\envs\dQP\lib\site-packages\qpth\solvers\pdipm\batch.py", line 380, in pre_factor_kkt
Q_LU = lu_hack(Q)
File "C:\ProgramData\anaconda3\envs\dQP\lib\site-packages\qpth\solvers\pdipm\batch.py", line 9, in lu_hack
data, pivots = torch.linalg.lu_factor(x, pivot=not x.is_cuda)
AttributeError: module 'torch.linalg' has no attribute 'lu_factor'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "runcarsim1.py", line 114, in
sys.exit(main())
File "runcarsim1.py", line 55, in main
control = controller(traj_ref, current_state)
File "C:\ProgramData\anaconda3\envs\dQP\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "D:\syf\differentiable-control\QPnet.py", line 44, in forward
x = self.dQP(traj_ref, current_state)
File "D:\syf\differentiable-control\QPnet.py", line 231, in dQP
deltU = QPFunction(verbose = 0)(Q_obj.double(), P_obj.double(), G.double(), h.double(), e, e)
File "C:\ProgramData\anaconda3\envs\dQP\lib\site-packages\qpth\qp.py", line 93, in forward
ctx.Q_LU, ctx.S_LU, ctx.R = pdipm_b.pre_factor_kkt(Q, G, A)
File "C:\ProgramData\anaconda3\envs\dQP\lib\site-packages\qpth\solvers\pdipm\batch.py", line 382, in pre_factor_kkt
raise RuntimeError("""
RuntimeError:
qpth Error: Cannot perform LU factorization on Q.
Please make sure that your Q matrix is PSD and has
a non-zero diagonal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions