pytorch-PCN
pytorch-PCN copied to clipboard
How to run the demo with GPU?
I try the demo, found that it uses CPU only, how can I use GPU with the model?
For a pytorch model, you can set model and input to CUDA model. e.g.
model.cuda()
input.cuda()
Then it will run on GPU~
Very good job @siriusdemon and thanks for sharing! Tried to push it to GPU but speed is almost same compared to CPU in my case, anybody more successful?
Some operations like NMS
is time-consuming. There are lots of for loop
in the code. Analyse the bottleneck by profile
and rewriting some code by Cython
may help.
It's not clear where
model.cuda()
input.cuda()
should be put to enable gpu processing. Would it maybe be possible for you to add that option directly in the api? That would be really great. Thanks in advance.
Very good job @siriusdemon and thanks for sharing! Tried to push it to GPU but speed is almost same compared to CPU in my case, anybody more successful?
I also found that although the GPU works, but the consumption is very small, and the detection speed is not much different from that of the CPU.Do you have a solution later?Thanks!
I tried to run on the GPU, but the speed dropped. What's going on? A total of several places have been changed. 1、models.py→load_model()→pcn1=PCN1.to(devices) pcn2.....ocn3.... 2、pcn.py→set_input()→return torch.FloatTensor(img).cuda()。 but speed goes down.How to run on GPU correctly?please