Skip to content

[Dreambooth] TypeError: get_scheduler() got an unexpected keyword argument 'num_cycles' #1817

@claudiogreco

Description

@claudiogreco

Describe the bug

Hello,

When I run diffusers/examples/dreambooth/train_dreambooth.py, I get the following error:

│   590 │   │   args.max_train_steps = args.num_train_epochs * num_update_step │
│   591 │   │   overrode_max_train_steps = True                                │
│   592 │                                                                      │
│ ❱ 593 │   lr_scheduler = get_scheduler(                                      │
│   594 │   │   args.lr_scheduler,                                             │
│   595 │   │   optimizer=optimizer,                                           │
│   596 │   │   num_warmup_steps=args.lr_warmup_steps * args.gradient_accumula │

TypeError: get_scheduler() got an unexpected keyword argument 'num_cycles'

The command line was:

accelerate launch train_dreambooth.py --train_text_encoder --pretrained_model_name_or_path="stabilityai/stable-diffusion-2-1-base" --instance_data_dir="/images" --output_dir="/models" --instance_prompt="a photo of ABC person" --resolution=512 --train_batch_size=2 --gradient_accumulation_steps=1 --learning_rate=1e-06 --lr_scheduler=constant --lr_warmup_steps=0 --max_train_steps=1000

I get the same issue described above also by using "runwayml/stable-diffusion-v1-5" as model.

How could I solve this issue? Thank you in advance for your attention.

Reproduction

The command line was:

accelerate launch train_dreambooth.py --train_text_encoder --pretrained_model_name_or_path="stabilityai/stable-diffusion-2-1-base" --instance_data_dir="/images" --output_dir="/models" --instance_prompt="a photo of ABC person" --resolution=512 --train_batch_size=2 --gradient_accumulation_steps=1 --learning_rate=1e-06 --lr_scheduler=constant --lr_warmup_steps=0 --max_train_steps=1000

Logs

No response

System Info

  • diffusers version: 0.11.1
  • Platform: Linux-5.15.0-1021-gcp-x86_64-with-glibc2.31
  • Python version: 3.9.15
  • PyTorch version (GPU?): 1.12.1 (True)
  • Huggingface_hub version: 0.11.1
  • Transformers version: 4.25.1
  • Using GPU in script?:
  • Using distributed or parallel set-up in script?:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions