Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run the demo with GPU? #5

Open
Edwardmark opened this issue Apr 25, 2019 · 6 comments
Open

How to run the demo with GPU? #5

Edwardmark opened this issue Apr 25, 2019 · 6 comments

Comments

@Edwardmark
Copy link

I try the demo, found that it uses CPU only, how can I use GPU with the model?

@siriusdemon
Copy link
Owner

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~

@FloCF
Copy link

FloCF commented Jul 18, 2019

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?

@siriusdemon
Copy link
Owner

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.

@fmatulic
Copy link

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.

@hhxdestiny
Copy link

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!

@wuyue112
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants