longcw / faster_rcnn_pytorch

Faster RCNN with PyTorch
MIT License
1.71k stars 466 forks source link

why multiple cpus are used in .cuda() mode #15

Open volkancirik opened 7 years ago

volkancirik commented 7 years ago

Hello,

I migrate the model to gpu. however it still uses cpu. any idea why that is the case?

thanks!

zhanghang1989 commented 7 years ago

Did you test nvidia-smi and check the gpu usage?

volkancirik commented 7 years ago

It is a submodule in my network. so both gpu and multiple cpus are active.

zhanghang1989 commented 7 years ago

Typically cpu handle the data preprocessing and communication with gpu.

volkancirik commented 7 years ago

Multiple cpus are used even rcnn is run in isolation.

volkancirik commented 7 years ago

do you observe the same behavior?

zhanghang1989 commented 7 years ago

I haven't checked the cpu usage, but the training was okay on my workstation.

volkancirik commented 7 years ago

thanks for the prompt response, I'll close the issue if I can track it down.

acgtyrant commented 7 years ago

This program contains some codes which process data in CPU, like this: https://github.com/longcw/faster_rcnn_pytorch/blob/master/faster_rcnn/faster_rcnn.py#L120-L122