yolov7-deepsort-tracking icon indicating copy to clipboard operation
yolov7-deepsort-tracking copied to clipboard

Problem of AssertionError: Invalid device id

Open YLL0209 opened this issue 2 years ago • 3 comments

Hello, good day. I have a problem regard of ''detector = Detector(classes = [0,17,32])''. After I run it on google colab, it keeps showing "AssertionError: Invalid device id". May I know how to solve it? Thank you

YLL0209 avatar Dec 20 '22 08:12 YLL0209

Thanks for putting it out to my notice. It should definitely not come from Detector class until unless you have a variable named device in your code or you're overriding the existing Detector class because the first line of the class inside __init__ is self.device = select_device("cuda" if torch.cuda.is_available() else 'cpu') which means it AUTOMATICALLY selects the device.

Can you please print the whole traceback in a formatted manner so that I can look at it. And it'd be great if you could tell me how to reproduce the error too. Thank you.

deshwalmahesh avatar Dec 24 '22 10:12 deshwalmahesh

Alright, thank you

Screenshot 2022-12-24 185258

YLL0209 avatar Dec 24 '22 10:12 YLL0209

Can you take the latest pull and let me know if that worked? You must have been using CUDA which I did not check with I suppose. I have only changed self.device inside the Detector class.

deshwalmahesh avatar Dec 30 '22 05:12 deshwalmahesh