serve icon indicating copy to clipboard operation
serve copied to clipboard

Default object detection handler works only on cuda:0 device in GPU machine

Open harshbafna opened this issue 6 years ago • 4 comments

Executing pre-trained FasterRCNN/MaskRCNN object detection modes using default object detection handler fails if GPU device other then cuda:0 is used.

Cuda:0 and CPU devices return similar response with minor floating point differences in the BB. However executing on different GPU devices like cuda:1, cuda:2 etc returns tensor/label/score for a single BB.

We created following ticket on PyTorch forum and still waiting for some guidelines to address this difference in behavior in multi-GPU environment for OD

https://discuss.pytorch.org/t/pytorch-different-output-on-different-cuda-device-for-fasterrcnn-maskrcnn/71867/3

For the time being the OD default handler is hard coded to use cuda:0 device in GPU environment

harshbafna avatar Mar 18 '20 04:03 harshbafna

Created following issue in TorchVision : https://github.com/pytorch/vision/issues/1993

harshbafna avatar Mar 19 '20 04:03 harshbafna

Just answered in the torchvision issue, I was unable to reproduce the issue with the provided snippet, using pytorch and torchvision nightlies

fmassa avatar Mar 19 '20 14:03 fmassa

As indicated in this comment, a new version of PyTorch / torchvision will be released in the next following weeks.

Till then the OD default handler will run on cuda:0 device only. The default handler will be updated once the fix is available in the stable release.

harshbafna avatar Mar 20 '20 09:03 harshbafna

Related PR has been merged hence closing this.

codinnvrends avatar Jun 10 '20 03:06 codinnvrends