Extraltodeus / depthmap2mask

Create masks out of depthmaps in img2img
355 stars 35 forks source link

Gpu memory leak #16

Closed VenkatLohithDasari closed 1 year ago

VenkatLohithDasari commented 1 year ago

Hey, As I constantly Generate Images. I see slow growth in GPU Memory, after generating around 10 images, GPU memory is 100% full. After that, It always Throws OOM Error..

I mainly use two models, one is MiDas_v21 and other is dpt_large. Doesn't matter which model it is.

flufy3d commented 1 year ago

I have same issue ,when I switch the depth gen model MiDas_v21 to small or to large

iterhating commented 1 year ago

I came here to make a similar comment: after a run using depthmap2mask the memory allocated during the run is not released, this is clearly visible in a resource monitor looking at the VRAM usage, and reproducible across two machines and several different attempts. Command line flags include --medvram, --full precision, and --no-halfs

The same thing happens with the depth mask script here , since they both use MiDAs, I'm guess that might be the common source for the error.

Extraltodeus commented 1 year ago

Ok so it appears that midas ads up to the GPU's memory after each use indeed. image

TingTingin commented 1 year ago

how to fix?

TingTingin commented 1 year ago

I made a pr for the fix you can check it if your still having issues https://github.com/Extraltodeus/depthmap2mask/pull/22

Extraltodeus commented 1 year ago

the merge is done, thank you @TingTingin