Torch.optim.lbfgs nan

The task is to reconstruct the 3D face of a single photo. The similar code is here. When I use adam to optimize as written in the code, it is very smooth, but I rewrite it as lbfgs optimization, and the loss always becomes nan after a period of time. For a week, can anyone help me

1 Like

Hello,I also met this problem,have u solved it?thx

no, :sob: if you solve the problem, please let me know

torch.optim.LBFGS doesn’t work for mini-batches,I see GitHub - hjmshi/PyTorch-LBFGS: A PyTorch implementation of L-BFGS. here which support multi-batch,but I cant understand the example shows about multi-batch.

1 Like

Is there any solution to this issue? i am getting nan