Default object detection handler works only on cuda:0 device in GPU machine
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
Created following issue in TorchVision : https://github.com/pytorch/vision/issues/1993
Just answered in the torchvision issue, I was unable to reproduce the issue with the provided snippet, using pytorch and torchvision nightlies
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.
Related PR has been merged hence closing this.