geopavlakos / hamer

HaMeR: Reconstructing Hands in 3D with Transformers
https://geopavlakos.github.io/hamer/
MIT License
326 stars 28 forks source link

RuntimeError: Cuda Out of Memory #28

Closed earth15354 closed 6 months ago

earth15354 commented 6 months ago

Hi, when I run the demo, I get the following error message: RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB.

After looking up this error online, I've tried reducing the batch size from the command line and added "torch.cuda.empty_cache()" to my code. However, I don't think the second solution would work because my device simply doesn't have enough GPU storage.

I was wondering if anyone else has had this error, and if so, whether they've found some sort of fix.

geopavlakos commented 6 months ago

What is the available GPU memory you have?

We recently updated the option for body detection in the demo (body_detector argument). When you use the option regnety, the code should run with less than 7GB of GPU memory. You might observe some small drop in accuracy when it comes to the hand detection aspect.