leongatys / PytorchNeuralStyleTransfer

Implementation of Neural Style Transfer in Pytorch
MIT License
421 stars 103 forks source link

Loss value not decreasing with LBFGS #4

Closed nithya4 closed 6 years ago

nithya4 commented 6 years ago

I run the same code, with the output initialized to the content image. When running the optimization with LBFGS, the loss values does not decrease.

Iteration: 50, loss: 479620896.000000 Iteration: 100, loss: 479620896.000000 ....

There are no updates to opt_img at all. Is there any reason that this could be happening? EDIT: There is an exploding gradient as well. I am wondering if there is any clamping that is required.

leongatys commented 6 years ago

Do you use CPU or GPU? I have seen people facing this problem when using CPU and I really don't know why this is happening.

nithya4 commented 6 years ago

I was this on just CPU at this point. Perhaps why.

Thanks for your insight, I'll move this to GPU rightaway.