I tried to build the model on another gpu device instead of cuda:0. I tried the with statement in torch and tried to pass the device to the gpu parameter of Reader as well. In both cases, the init is ok.
However, it will reports an exception like
RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cuda:1
This seems to be caused by missing specifying the device_ids parameter in DataParallel in the 62nd line in get_detector function in detection.py and the 157th line in get_recognizer function in recognition.py.
I modified the original code such as
net = torch.nn.DataParallel(net).to(device)
to
net = torch.nn.DataParallel(net, device_ids=[torch.device(device)]).to(device)
And the exception disappeared.
Maybe you could make a little modification to fix this minor problem. Thanks very much!
I tried to build the model on another gpu device instead of
cuda:0. I tried thewithstatement in torch and tried to pass the device to thegpuparameter ofReaderas well. In both cases, the init is ok.However, it will reports an exception like
This seems to be caused by missing specifying the
device_idsparameter inDataParallelin the 62nd line inget_detectorfunction indetection.pyand the 157th line inget_recognizerfunction inrecognition.py.I modified the original code such as
to
And the exception disappeared.
Maybe you could make a little modification to fix this minor problem. Thanks very much!