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 509 forks source link

TypeError: Accelerator.__init__() got an unexpected keyword argument 'logging_dir' #239

Closed tumielsexshop closed 1 year ago

tumielsexshop commented 1 year ago

Describe the bug

TypeError: Accelerator.init() got an unexpected keyword argument 'logging_dir'

Reproduction

2023-06-07 23:22:05.427601: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT ╭───────────────────── Traceback (most recent call last) ──────────────────────╮ │ /content/train_dreambooth.py:869 in │ │ │ │ 866 │ │ 867 if name == "main": │ │ 868 │ args = parse_args() │ │ ❱ 869 │ main(args) │ │ 870 │ │ │ │ /content/train_dreambooth.py:425 in main │ │ │ │ 422 def main(args): │ │ 423 │ logging_dir = Path(args.output_dir, "0", args.logging_dir) │ │ 424 │ │ │ ❱ 425 │ accelerator = Accelerator( │ │ 426 │ │ gradient_accumulation_steps=args.gradient_accumulation_steps, │ │ 427 │ │ mixed_precision=args.mixed_precision, │ │ 428 │ │ log_with="tensorboard", │ ╰──────────────────────────────────────────────────────────────────────────────╯ TypeError: Accelerator.init() got an unexpected keyword argument 'logging_dir'

Logs

No response

System Info

??

imccainiao commented 1 year ago

Also have the same problem.

winstoncesar commented 1 year ago

I have the same problem too. Maybe @ShivamShrirao could help?

NatalieHanzhina commented 1 year ago

From the official huggingface repo's issue:

This is now project_dir (not logging_dir), and you should have been seeing warnings of it being deprecated for the last few accelerate versions.

imccainiao commented 1 year ago

From the official huggingface repo's issue:

This is now project_dir (not logging_dir), and you should have been seeing warnings of it being deprecated for the last few accelerate versions.

thanks after i replace logging_dir by project_dir in file "train_dreambooth.py" ,it works

NatalieHanzhina commented 1 year ago

@ShivamShrirao I made a PR

SashaAlexandra22 commented 1 year ago

From the official huggingface repo's issue: This is now project_dir (not logging_dir), and you should have been seeing warnings of it being deprecated for the last few accelerate versions.

thanks after i replace logging_dir by project_dir in file "train_dreambooth.py" ,it works

Thank you, @imccainiao. Im trying to replace logging_dir to project_dir and it doesnt work. Can you be more specific, please? At what line i should replace that?

VladAdushev commented 1 year ago

From the official huggingface repo's issue: This is now project_dir (not logging_dir), and you should have been seeing warnings of it being deprecated for the last few accelerate versions.

thanks after i replace logging_dir by project_dir in file "train_dreambooth.py" ,it works

Thank you, @imccainiao. Im trying to replace logging_dir to project_dir and it doesnt work. Can you be more specific, please? At what line i should replace that?

Where did you find this line?

NatalieHanzhina commented 1 year ago

In this line change _logging_dir=loggingdir to _project_dir=loggingdir

VladAdushev commented 1 year ago

I don't have many lines !python3 train_dreambooth.py \ --pretrained_model_name_or_path=$MODEL_NAME \ --pretrained_vae_name_or_path="stabilityai/sd-vae-ft-mse" \ --output_dir=$OUTPUT_DIR \ --revision="fp16" \ --with_prior_preservation --prior_loss_weight=1.0 \ --seed=1337 \ --resolution=512 \ --train_batch_size=1 \ --train_text_encoder \ --mixed_precision="fp16" \ --use_8bit_adam \ --gradient_accumulation_steps=1 \ --learning_rate=1e-6 \ --lr_scheduler="constant" \ --lr_warmup_steps=0 \ --num_class_images=50 \ --sample_batch_size=4 \ --max_train_steps=800 \ --save_interval=10000 \ --save_sample_prompt="photo of zwx dog" \ --concepts_list="concepts_list.json"

imccainiao commented 1 year ago

From the official huggingface repo's issue: This is now project_dir (not logging_dir), and you should have been seeing warnings of it being deprecated for the last few accelerate versions.

thanks after i replace logging_dir by project_dir in file "train_dreambooth.py" ,it works

Thank you, @imccainiao. Im trying to replace logging_dir to project_dir and it doesnt work. Can you be more specific, please? At what line i should replace that?

i simply replace all of the "logging_dir" in file "train_dreambooth.py".

imccainiao commented 1 year ago

I don't have many lines !python3 train_dreambooth.py --pretrained_model_name_or_path=$MODEL_NAME --pretrained_vae_name_or_path="stabilityai/sd-vae-ft-mse" --output_dir=$OUTPUT_DIR --revision="fp16" --with_prior_preservation --prior_loss_weight=1.0 --seed=1337 --resolution=512 --train_batch_size=1 --train_text_encoder --mixed_precision="fp16" --use_8bit_adam --gradient_accumulation_steps=1 --learning_rate=1e-6 --lr_scheduler="constant" --lr_warmup_steps=0 --num_class_images=50 --sample_batch_size=4 --max_train_steps=800 --save_interval=10000 --save_sample_prompt="photo of zwx dog" --concepts_list="concepts_list.json"

i simply replace all of the "logging_dir" in file "train_dreambooth.py". you must edit the file "train_dreambooth.py".

VladAdushev commented 1 year ago

you must edit the file "train_dreambooth.py". Tell me how to edit it? Do it in the browser?

imccainiao commented 1 year ago

you must edit the file "train_dreambooth.py". Tell me how to edit it? Do it in the browser?

i run this project in colab then i download the file"train_dreambooth.py" and edit by notpad.exe finally upload it to the colab again

VladAdushev commented 1 year ago

Thank you. Okay, I'll wait for Shivam Shrirao to fix it, I can't beat it.

ShivamShrirao commented 1 year ago

Merged https://github.com/ShivamShrirao/diffusers/pull/240

SashaAlexandra22 commented 1 year ago

In this line change _logging_dir=loggingdir to _project_dir=loggingdir

Wooohoo! You saved our day, @ShivamShrirao and @NatalieHanzhina - i tried to replace that code, but it is already corrected! Thank you both!

Hbhatt-merexgenAI commented 1 year ago

TypeError: Accelerator.init() got an unexpected keyword argument 'project_dir'