zhanghang1989 / PyTorch-Multi-Style-Transfer

Neural Style and MSG-Net
http://hangzh.com/PyTorch-Style-Transfer/
MIT License
979 stars 206 forks source link

Running the Camera Demo with CPU results in "TypeError: 'torch.FloatTensor' object is not callable" #23

Open masarun opened 6 years ago

masarun commented 6 years ago

With Ananoda3 (Python 3.6.5) on Windows, trying to run "python camera_demo.py demo --model models/21styles.model --cuda=0" ended up with the following error.

Traceback (most recent call last): File "camera_demo.py", line 104, in main() File "camera_demo.py", line 101, in main run_demo(args, mirror=True) File "camera_demo.py", line 66, in run_demo simg = style_v.data().numpy() TypeError: 'torch.FloatTensor' object is not callable

This issue seemed to be fixed with the following change in the line 60 of camera_demo.py from simg = style_v.data().numpy() to simg = style_v.data[0].numpy()

Chenfengldw commented 5 years ago

Same problem,
File "camera_demo.py", line 109, in main() File "camera_demo.py", line 106, in main run_demo(args, mirror=True) File "camera_demo.py", line 73, in run_demo simg = style_v.data().numpy() TypeError: 'Tensor' object is not callable