mit-han-lab / anycost-gan

[CVPR 2021] Anycost GANs for Interactive Image Synthesis and Editing
https://hanlab.mit.edu/projects/anycost-gan/
MIT License
776 stars 97 forks source link

mean style requires cuda tensor but got ''cpu'' while runing demo.py #4

Closed yian2271368 closed 3 years ago

yian2271368 commented 3 years ago

https://github.com/mit-han-lab/anycost-gan/blob/19229bdc525ecd00ca7c2322b192504325bda9e0/models/anycost_gan.py#L85 here 'z' is "cpu" device while self.style needs "cuda" tensor??? Error is: RuntimeError: input must be a CUDA tensor i figured out the reason is the code then running to FusedLeakyReLUFunction ,which requires CUDA tensor. But in demo.py, the device is "cpu". Any idea how to fix this problem?

tonylins commented 3 years ago

Hi, sorry about that. The demo was tested on a CPU-only machine, which fails to expose the problem.

You can run the demo with FORCE_NATIVE=1 python demo.py

yian2271368 commented 3 years ago

thank you! that works!