Comments (21)
It's not working on 6GB GeForce RTX 3060
OK we know. Let us solve 6GB now.
from controlnet.
I will try to add sliced attention this weekend. (and copy some codes from Automatic1111 perhaps.)
Right now it seems the model OOM on 8GB gpus.
See also CompVis/stable-diffusion#39
from controlnet.
Low VRAM mode added.
https://github.com/lllyasviel/ControlNet/blob/main/docs/low_vram.md
Tested on several 8GB cards. Lets see if work on 6GB.
from controlnet.
Great, thanks! I have a 12GB vram gpu, does it also work for training ? Currently I can't train, even with a batch size of 1 I get OOM errors
from controlnet.
@My12123
Maybe you can make save_memory = True
in config.py
if you have not already. That will make at least the canny model to run on 8 GB GPU. I tried it with RTX 3070.
Also, you can install xformers with pip install xformers
. It seems to work pretty well in saving a gigabyte or so of memory and the inference is twice as fast. If you install xformers, just make sure you have PyTorch 1.13.1 (the latest as of now).
from controlnet.
I also tried xformers, but I keep getting No operator found for
memory_efficient_attention_backward
.
I've seen this too and I suspect it was a faulty installation in my case. I had pytorch 1.13.1 from conda & in a conda env, installed xformers via pip, and nvm my conda xformers install had issues.memory_efficient_attention_backward
was the error. After replacing xformers with its conda release, the error was gone and I was back to oom at the beginning of the training (also on 12GB vram).
from controlnet.
Yes. But it also works if we use the latest version of PyTorch, along with the latest version of PyTorch lightning.
from controlnet.
same here
from controlnet.
Amazing work, very inspiring and i can't wait to try this. For now, just spent all day downloading and troubleshooting on my slow internet, just to find this OOM. I'm on 6gb 1660ti, so i have to run 1111 with --medvram --precision full --no-half.... Any hope at all of this ever working for me, or should i write this one off? Any chance for a Colab notebook for the rest of us?..
from controlnet.
Great, thanks! I have a 12GB vram gpu, does it also work for training ? Currently I can't train, even with a batch size of 1 I get OOM errors
will try. but it should work perhaps since attention layer is sliced already.
from controlnet.
I also tried using xformers but I kept having incompatibility issues
from controlnet.
It's not working on 6GB GeForce RTX 3060
from controlnet.
Great, thanks! I have a 12GB vram gpu, does it also work for training ? Currently I can't train, even with a batch size of 1 I get OOM errors
Same. Besides batch size, I also tried with accumulate_grad_batches
and save_memory
, but still no luck to train with 12GB vram. I also tried xformers, but I keep getting No operator found for `memory_efficient_attention_backward
.
from controlnet.
Hello.
Great work with ControlNet. Any updates on 6GB VRAM solutions?
from controlnet.
I still have this error save_memory = True
it didn't help much
RuntimeError: CUDA out of memory. Tried to allocate 290.00 MiB (GPU 0; 8.00 GiB total capacity; 6.29 GiB already allocated; 0 bytes free; 7.08 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
from controlnet.
The version mentionned in environment.yaml
is 1.12.1 though.
Line 9 in 3e1340d
from controlnet.
I am not able to train the network. Even I am using the save memory option. @sovit-123 can you help me.
from controlnet.
@engrmusawarali
Hi, even with the save memory option you need at least 18 GB of VRAM to train the model. That's what I found out when it was initially released. Not sure if that requirement has changed since then.
from controlnet.
have you tried small-scale training. if yes then how to process with it can you guide me @sovit-123
from controlnet.
@engrmusawarali
I have not tried it yet. But planning to do it soon.
from controlnet.
the training doesnt work on 12GB vram rtx 3060
from controlnet.
Related Issues (20)
- a
- How long it takes to test an image HOT 3
- Unable to install gradio=3.40.1 HOT 3
- Training a ControlNet to generate furnished room -> empty room (and vice versa). Improvement plateau...
- Comfy UI / Stable Diffusion error
- I would like a complete technical description of how controlnet works
- Unable to Connect to Hugging Face for Model Download in China Mainland HOT 4
- save checkpoint
- How do I find the size of the set epoch
- dataset include different sizes
- trainable copy also means "require_grad==False"
- Art for Web Platforms grid, various set of product items, kitchenware, cutlery, biodegradable bags, bioplastics, eco friendly, trashbag, pet waste, varied, grid, 3D objects set, plastic bags, Creating art for web platforms, often for websites, online galleries, or digital user experiences. Negative prompt: text, repetition, same, noisy, noise, glitch, grainy, blurred, pixelated, unrealistic, malformed, bad, abnormal, print art, digital art Steps: 30, Sampler: Euler a, CFG scale: 7, Seed: 1178069234, Size: 1024x1024, Model hash: 9550adb9d6, Model: nightvisionXLPhotorealisticPortrait_v0743ReleaseBakedvae, ControlNet 0: "Module: softedge_pidinet, Model: bdsqlsz_controlllite_xl_softedge [c28ff1c4], Weight: 0.5, Resize Mode: Crop and Resize, Low Vram: False, Processor Res: 512, Guidance Start: 0, Guidance End: 0.19, Pixel Perfect: False, Control Mode: Balanced, Hr Option: Both, Save Detected Map: True", Version: v1.7.0 Error Time taken: 16.2 sec. A: 5.58 GB, R: 12.72 GB, Sys: 13.2/15.7314 GB (84.1%)
- cannot import name 'Undefined' from 'pydantic.fields' Error HOT 2
- Use openpose in Guessmode
- nvm
- Load CLIPTokenizer error HOT 1
- erorr "cond_stage_model.transformer.text_model.embeddings.position_ids" HOT 2
- training is so slow HOT 2
- ERROR: Exception in ASGI application
- ControlNet cannot refresh the model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controlnet.