ControlNet icon indicating copy to clipboard operation
ControlNet copied to clipboard

Running tutorial_train.py still OOM

Open xwg0508 opened this issue 2 years ago • 2 comments

I enable the low_vram_shift, set the batch_size=1, and set accumulate_grad_batches=4, besides I import xformers, but still OOM. My gpu memory is 10.75GB, why it isn't work? 微信图片编辑_20230508105934

xwg0508 avatar May 08 '23 03:05 xwg0508

What's your GPU ?

shravankumar147 avatar May 13 '23 06:05 shravankumar147

RTX 2080 Ti

xwg0508 avatar May 13 '23 14:05 xwg0508

> 24G is all you need (e.g. RTX 3090, V100)

qsun1 avatar Jun 06 '23 04:06 qsun1

I enable the low_vram_shift, set the batch_size=1, and set accumulate_grad_batches=4, besides I import xformers, but still OOM. My gpu memory is 10.75GB, why it isn't work? 微信图片编辑_20230508105934

Same problem. Couldn't run training out-of-the-box on AWS EC2 p3.2xlarge (V100, 16GB VRAM) with all memory reduction options active.

dennisalp avatar Jun 24 '23 13:06 dennisalp

if you have acess to 4 2080 gpus ,will it work!? also with lower preecision!?

AparnaAgrawal02 avatar Aug 17 '23 15:08 AparnaAgrawal02

you can use the HuggingFace Diffusers ControlNet training script https://huggingface.co/docs/diffusers/training/controlnet Min 12GB on Windows, or 8GB on Linux (requires DeepSpeed, which is only available on Linux) I wrote a long article on how to train control nets https://civitai.com/articles/2078

geroldmeisinger avatar Sep 17 '23 08:09 geroldmeisinger

all duplicate concerning "RAM and out of memory exceptions (OOM)": https://github.com/lllyasviel/ControlNet/issues/21 https://github.com/lllyasviel/ControlNet/issues/33 https://github.com/lllyasviel/ControlNet/issues/191 https://github.com/lllyasviel/ControlNet/issues/236 https://github.com/lllyasviel/ControlNet/issues/241 https://github.com/lllyasviel/ControlNet/issues/247 https://github.com/lllyasviel/ControlNet/issues/294 https://github.com/lllyasviel/ControlNet/issues/301

geroldmeisinger avatar Sep 17 '23 12:09 geroldmeisinger