Hi,
Thank you for your work, but I have a problem when I run lpips loss on my computer with one GPU. All inputs of lpips are on device "cuda:0", but I am given an error (RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!). Details of error are shown as below. And version of lpips is 0.1.4.
File "losses/Lpips_Loss.py", line 47, in forward loss = self.loss(input[:, (2, 1, 0), ...], target[:, (2, 1, 0), ...], normalize=True) File "/**/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/**/lib/python3.8/site-packages/lpips/lpips.py", line 118, in forward in0_input, in1_input = (self.scaling_layer(in0), self.scaling_layer(in1)) if self.version=='0.1' else (in0, in1) File "/**/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/**/lib/python3.8/site-packages/lpips/lpips.py", line 154, in forward return (inp - self.shift) / self.scale RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
Thanks.
Hi, Thank you for your work, but I have a problem when I run lpips loss on my computer with one GPU. All inputs of lpips are on device "cuda:0", but I am given an error (RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!). Details of error are shown as below. And version of lpips is 0.1.4.
File "losses/Lpips_Loss.py", line 47, in forward loss = self.loss(input[:, (2, 1, 0), ...], target[:, (2, 1, 0), ...], normalize=True) File "/**/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/**/lib/python3.8/site-packages/lpips/lpips.py", line 118, in forward in0_input, in1_input = (self.scaling_layer(in0), self.scaling_layer(in1)) if self.version=='0.1' else (in0, in1) File "/**/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/**/lib/python3.8/site-packages/lpips/lpips.py", line 154, in forward return (inp - self.shift) / self.scale RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
Thanks.