PyTorch-LBFGS icon indicating copy to clipboard operation
PyTorch-LBFGS copied to clipboard

RuntimeError: Expected object of type torch.FloatTensor but found type torch.DoubleTensor for argument #3 'other'

Open jihaonew opened this issue 5 years ago • 2 comments

The error occurs in functions/LBFGS.py, line 854. I think this error comes from t. It becomes a double precision number with the process of convergence. I tried

if(F_new > F_k + (c1*t*gtd).float()):

or

if(F_new.double() > F_k.double() + (c1*t*gtd)):

However, if I do so, the loss will not decrease any more.

jihaonew avatar Apr 11 '19 06:04 jihaonew

Thanks! Let me look into it. Is this with a particular network or problem that you are looking at?

hjmshi avatar Apr 11 '19 17:04 hjmshi

I working on a non-linear least squares problem with highly-dense Jacobian.

jihaonew avatar Apr 12 '19 05:04 jihaonew