Out of Memory Error

#1
by sapg - opened

Does anyone know how I get past this OOM error? My graphics card has 12Gb of RAM.

.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1143, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 10.91 GiB total capacity; 10.50 GiB already allocated; 2.44 MiB free; 10.76 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

If I set this environment variable:

export PYTORCH_CUDA_ALLOC_CONF=backend:cudaMallocAsync

Then I get a slightly different message:

.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1143, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
torch.cuda.OutOfMemoryError: Allocation on device 0 would exceed allowed memory. (out of memory)
Currently allocated     : 10.72 GiB
Requested               : 5.00 MiB
Device limit            : 10.91 GiB
Free (according to CUDA): 30.44 MiB
PyTorch limit (set by user-supplied memory fraction)
                        : 17179869184.00 GiB

Looks like its been updated with more cn options and settings that are memory hogs, depthanything is quite large. Try changing lines 268, 269 in app.py to max_side=820, min_side=678

Did you ever get this resolved? I get the same out of memory error. I've tried to edit the app.py file's max_side values as mentioned above.

Afraid not, I ran out of time to play. I'll come back and let you know if I ever get it to work.

Sign up or log in to comment