locuslab / optnet

OptNet: Differentiable Optimization as a Layer in Neural Networks
Apache License 2.0
513 stars 75 forks source link

RuntimeError: invalid argument 3: dimensions of A and b must be equal #5

Open Blanchedingding opened 6 years ago

Blanchedingding commented 6 years ago

When I used the optnet to run all the three experiments, I got the following error:

` RuntimeError: invalid argument 3: dimensions of A and b must be equal at /pytorch/torch/lib/TH/generic/THTensorLapack.c:1036

/usr/local/lib/python3.5/dist-packages/qpth/solvers/pdipm/batch.py(357)solve_kkt() 355 h = (invQ_rx.unsqueeze(1).bmm(G.transpose(1, 2)) + rs / d - rz).squeeze(1) 356 --> 357 w = -(h.btrisolve(*S_LU)) 358 359 g1 = -rx - w[:, neq:].unsqueeze(1).bmm(G) `

Did I miss something or do something wrong with the qpth or other environment? I can run the fc and lenet network in the classification experiment. Since I don't have a CUDA, I uncomment all the “.cuda()” in the models.py

weizheliu commented 6 years ago

Same problem. I solve this by downgrade pytorch to 0.12, it seems like optnet now doesn't compatible with pytorch 0.2 and 0.3.