DeepImageBlending
DeepImageBlending copied to clipboard
LBFGS raises Runtime Error
When I run "run.py" script, I get the following error. Error raised from the optimizer. How can I solve this. Now, I can running only first stage without solved this issue.
Exception has occurred: RuntimeError
view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
File "../DeepImageBlending/run.py", line 219, in <module>
optimizer.step(closure)
Have you solved the problem and how?Thanks!
No, I couldn't solve it.
I was able to solve this by changing line 171 from: first_pass_img = torch.from_numpy(first_pass_img).unsqueeze(0).transpose(1,3).transpose(2,3).float().to(gpu_id) to first_pass_img = torch.from_numpy(first_pass_img).unsqueeze(0).transpose(1,3).transpose(2,3).contiguous().float().to(gpu_id)
just making that img var contiguous.
Oh my God, I solve this problem using this method. Thanks a lot!