OS:Ubuntu18.04
pytorch:1.1.0
When I run /pytorch-tutorial-master/tutorials/03-advanced/neural_style_transfer/main.py, I got errors:
Traceback (most recent call last): File "/home/gaoya/Files/python/pytorch/pytorch-tutorial-master/tutorials/03-advanced/neural_style_transfer/main.py", line 169, in <module> main(config) File "/home/gaoya/Files/python/pytorch/pytorch-tutorial-master/tutorials/03-advanced/neural_style_transfer/main.py", line 153, in main img = denorm(img).clamp_(0, 1) File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 163, in __call__ return F.normalize(tensor, self.mean, self.std, self.inplace) File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py", line 208, in normalize tensor.sub_(mean[:, None, None]).div_(std[:, None, None]) RuntimeError: expected backend CUDA and dtype Float but got backend CPU and dtype Float
OS:Ubuntu18.04 pytorch:1.1.0 When I run
/pytorch-tutorial-master/tutorials/03-advanced/neural_style_transfer/main.py
, I got errors:Traceback (most recent call last): File "/home/gaoya/Files/python/pytorch/pytorch-tutorial-master/tutorials/03-advanced/neural_style_transfer/main.py", line 169, in <module> main(config) File "/home/gaoya/Files/python/pytorch/pytorch-tutorial-master/tutorials/03-advanced/neural_style_transfer/main.py", line 153, in main img = denorm(img).clamp_(0, 1) File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py", line 163, in __call__ return F.normalize(tensor, self.mean, self.std, self.inplace) File "/usr/local/lib/python3.6/dist-packages/torchvision/transforms/functional.py", line 208, in normalize tensor.sub_(mean[:, None, None]).div_(std[:, None, None]) RuntimeError: expected backend CUDA and dtype Float but got backend CPU and dtype Float
Can someone help me?