ShivamShrirao / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch
https://huggingface.co/docs/diffusers
Apache License 2.0
1.89k stars 506 forks source link

Dreambooth won't start: [00:51:51] WARNING The following values were not passed to #222

Closed Leomn1234 closed 1 year ago

Leomn1234 commented 1 year ago

Describe the bug

Getting this whenever I run train_dreambooth.py on Colab but it won't get passed it, it seems to freeze up and just run and not do anything with this warning and the cursor keeps blinking, until you stop the cell, then it just stops immediately when you try to run it after that. It has always worked before, and no changes on my end. Think it might be an issue with accelerate. Have no other info.

Reproduction

[00:51:51] WARNING The following values were not passed to

Logs

[00:51:51] WARNING  The following values were not passed to

System Info

Colab notebook

oloflindh commented 1 year ago

I have the exact same problem 🥶

OoAnikioO commented 1 year ago

me too but it keeps generating person in the data directory

harini-shre commented 1 year ago

I am also facing the same issue.

I checked my google drive, the instance images uploaded were also not present in the google drive.

kshahnazari1998 commented 1 year ago

Confirming that I am also seeing this error. Tried passing different arguments but was not able to find the issue. This happened around 2 days ago.

The only thing that I'm seeing that might have changed is that the xformers library repo had an update 2 days ago. My best guess is that an update on that broke the notebook.

kshahnazari1998 commented 1 year ago

Tried running the notebook while installing the previous version of xformers==0.0.17rc481 but that did not solve the issue

jmaccall316 commented 1 year ago

I think it might be a Google end problem unless anyone can confirm it's also happening on local PC. I've looked into several things and can't pinpoint it. If anyone has success please let us know here, since he might not get to until after the weekend. I just hope it's not a serious or unfixable issue.

jmaccall316 commented 1 year ago

Now it seems to running but still not displaying. I switched from the custom model I was trying to fine-tune to SD1-5, also removed the --read_prompts_from_txts argument that I usually use. I'm not sure if any of these at least made it run or not, too many combinations of things to try. We'll see if it completes and generates samples, etc.

Update: Can confirm that despite the warning and no display the script is running. I received accurate samples in my GDrive after 2K steps.

As I mentioned, might be something to do with custom models or read_prompts_from_txts that is causing it to not run at all. The display issue, no idea...

hntrssthmpsn commented 1 year ago

The display issue appears to be specific to the use of accelerate launch. I was able to bypass it by changing this:

!accelerate launch train_dreambooth.py

to:

!/usr/bin/python3 train_dreambooth.py

jmaccall316 commented 1 year ago

The display issue appears to be specific to the use of accelerate launch. I was able to bypass it by changing this:

!accelerate launch train_dreambooth.py

to:

!/usr/bin/python3 train_dreambooth.py

Will confirm that this seems directly tied to accelerate launch. Using you your above changes it does indeed return the display and seems to work as normal.

Thanks for sharing your solution, hntrssthmpsn

hntrssthmpsn commented 1 year ago

There was a new version of accelerate released 2 days ago, which sounds like it coincides with the onset of this issue. It's possible that just pinning accelerate to 0.17.1 would also resolve the issue.

jmaccall316 commented 1 year ago

Will see if that works, can bind a version pretty easy for anyone as dumb as me, replace line 5 of the "Install Requirements" cell with:

%pip install -q accelerate==0.17.1 transformers ftfy bitsandbytes==0.35.0 gradio natsort safetensors xformers

jeremyg7 commented 1 year ago

getting this error when i use: !/usr/bin/python3 train_dreambooth.py

"train_dreambooth.py: error: the following arguments are required: --instance_data_dir, --instance_prompt"

but i definitely ran the cell that assigned those, so not sure. also tried the 0.17.1 but still got the Warning error.

rajdeepjaiswall commented 1 year ago

I have been using your repository to create images out of a pre-trained model, and it has been working well. However, when I tried to train a model using your repository, I encountered an error that seems to indicate a problem with the repository.

I have tried troubleshooting the issue using the steps recommended by ChatGPT, including checking my internet connection, verifying the repository URL, refreshing the page, clearing my browser's cache, and using a different repository. However, none of these steps have resolved the issue.

Upon inquiring with ChatGPT, it was suggested that I contact the repository owner to report the issue. I would appreciate it if you could investigate this issue and provide a fix as soon as possible, as it is preventing me from using your repository for my work.

jmaccall316 commented 1 year ago

getting this error when i use: !/usr/bin/python3 train_dreambooth.py

"train_dreambooth.py: error: the following arguments are required: --instance_data_dir, --instance_prompt"

but i definitely ran the cell that assigned those, so not sure. also tried the 0.17.1 but still got the Warning error.

Try it using just the !/usr/bin/python3 train_dreambooth.py method in the run cell but not changing the accelerate version in the installation. I actually didn't change it, I just assumed it worked, The !/usr/bin/python3 train_dreambooth.py works on it's own with no other changes. My bad.

ShivamShrirao commented 1 year ago

Made a bandaid fix for now 17ff5f59d26c9abc86ccf44df240951e0c68a27d

jmaccall316 commented 1 year ago

Made a bandaid fix for now 17ff5f5

Sorry to reply the closed thread. Accelerate launch seems to work when you add the following code cell or maybe place it in train_dreambooth.py

from accelerate.utils import write_basic_config

write_basic_config()
geocine commented 1 year ago

from accelerate.utils import write_basic_config

write_basic_config()

are you saying can add this anywhere before training starts?

jmaccall316 commented 1 year ago

from accelerate.utils import write_basic_config write_basic_config()

are you saying can add this anywhere before training starts?

Yes, make a new cell and run it right before you begin training, but you would need to change !python3 back to !accelerate launch in the dreambooth train cell, or there is no point...

BajrangWappnet commented 9 months ago
2023-12-19 15:03:08.982737: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2023-12-19 15:03:08.982794: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2023-12-19 15:03:08.984081: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2023-12-19 15:03:10.289076: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
[15:03:11] WARNING  The following values were not passed to `accelerate launch` and 

Facing this issue still when i try to run the below code

!accelerate launch train_dreambooth.py \ --pretrained_model_name_or_path= "CompVis/stable-diffusion-v1-4" \ --instance_data_dir="/content/data/sks" \ --class_data_dir="/content/data/guy" \ --output_dir="/content/drive/MyDrive/stable_diffusion_weights/sks" \ --with_prior_preservation --prior_loss_weight=1.0 \ --instance_prompt="photo of Bajrang guy" \ --class_prompt="photo of a guy" \ --seed=1337 \ --resolution=512 \ --train_batch_size=1 \ --mixed_precision="fp16" \ --use_8bit_adam \ --gradient_accumulation_steps=1 \ --learning_rate=5e-6 \ --lr_scheduler="constant" \ --lr_warmup_steps=0 \ --num_class_images=50 \ --sample_batch_size=4 \ --max_train_steps=1000