kjunelee / MetaOptNet

Meta-Learning with Differentiable Convex Optimization (CVPR 2019 Oral)
Apache License 2.0
529 stars 97 forks source link

Error in the SVM Head #10

Closed goldblum closed 5 years ago

goldblum commented 5 years ago

Hi, I'm trying to run your code with the SVM-CS head. I get an error in line 296 of the "classification_heads.py" file. The error is as follows:

File "/home/user/Desktop/MetaLearning/models/classification_heads.py", line 396, in MetaOptNetHead_SVM_CS qp_sol = QPFunction(verbose=False, maxIter=maxIter)(G, e.detach(), C.detach(), h.detach(), A.detach(), b.detach()) File "/home/user/.local/lib/python2.7/site-packages/qpth/qp.py", line 91, in forward self.Q_LU, self.S_LU, self.R = pdipm_b.pre_factor_kkt(Q, G, A) File "/home/user/.local/lib/python2.7/site-packages/qpth/solvers/pdipm/batch.py", line 399, in pre_factor_kkt G_invQ_GT = torch.bmm(G, G.transpose(1, 2).btrisolve(*Q_LU)) TypeError: btrisolve() takes exactly 3 arguments (4 given)

I can't figure out how to fix this issue. I'm running the code in Python2 with the same package versions. Thank you for your help, Micah

kjunelee commented 5 years ago

I remember I had the same issue in the past, but I think it was resolved by upgrading the packages. Could you try the following version of packages? qpth 0.0.13 PyTorch 1.0.1.post2

goldblum commented 5 years ago

Thanks, this works.