YOLOP
YOLOP copied to clipboard
Is it wrong for multiple gpus: "return torch.device('cuda:0' if cuda else 'cpu')"
Hello,
I found this code:
"return torch.device('cuda:0' if cuda else 'cpu')" at the end of select_device function in utils.py.
Is it wrong for multiple GPU systems?
If you are running in multiple GPUs, I can see that it works fine. However, if you have multiple GPUs and you want to use a specific one, e.g. cuda:1 you will get the following error
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1!
So, this should be changed accordingly to the desired GPU id.