Grounded-Segment-Anything icon indicating copy to clipboard operation
Grounded-Segment-Anything copied to clipboard

Why do I run on cpu and not GPU?

Open guchuntao opened this issue 1 year ago • 5 comments

torch 1.9.0+cu111 torchvision 0.10.0+cu111 It's very slow,cpu usage is up to 2000%+ Does anyone know how to solve this problem? thanks!

guchuntao avatar Apr 13 '23 09:04 guchuntao

to execute the models in GPU add .to(device = 'cuda') at the end of GroundingDINO and SAM model.

If the execution consumes a lot of ram try to use a light version of the model of the weight. Else, you can use google colab

AnasCHARROUD avatar Apr 13 '23 14:04 AnasCHARROUD

I have loaded the model into the gpu and I can see with nvidia-smi that the memory is increased, but it is still running on the cpu

guchuntao avatar Apr 14 '23 05:04 guchuntao

What's the minimum GPU RAM for this project?

HamGuy avatar Apr 17 '23 10:04 HamGuy

to execute the models in GPU add .to(device = 'cuda') at the end of GroundingDINO and SAM model.

If the execution consumes a lot of ram try to use a light version of the model of the weight. Else, you can use google colab

I tried to change all the devices to cuda , but everytime I am running using cuda as a device my jupyter kernel crashes. But when I use cpu it works perfectly .

TestPrab avatar Apr 18 '23 10:04 TestPrab

@guchuntao Do you solve this problem? I also find that the CPU usage is very high but I ensure that all models are loaded in GPUs.

Delicious-Bitter-Melon avatar Jun 06 '24 02:06 Delicious-Bitter-Melon