longzw1997 / Open-GroundingDino

This is the third party implementation of the paper Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection.
MIT License
457 stars 71 forks source link

Inference device problem #58

Open chau25102001 opened 9 months ago

chau25102001 commented 9 months ago

Hi, thanks for your great work. I've tried to infer on an image with the script inference_on_an_image.py, it works ok and some boxes are detected. But when I tried again on the same image and replaced lines like device = "cuda" if not cpu_only else "cpu" to device = "cuda:1" if not cpu_only else "cpu" to run on a different GPU, the code still runs but there is no box detected. The code works ok with device = "cuda:0" though. What could be the issue?

P/S: I notice when device = "cuda:1" both GPU:0 and GPU:1 on my machine witness some VRAM increase. image

Here is the result when device = "cuda" or device = "cuda:0": image

And when device = "cuda:1": image