Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix IsADirectoryError when running the training code for sd3_dreambooth_lora_16gb.ipynb #9634

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

alaister123
Copy link
Contributor

@alaister123 alaister123 commented Oct 10, 2024

fix IsADirectoryError when running the training code

What does this PR do?

Fixes the training code crashing for sd3_dreambooth_lora_16gb.ipynb
Running the current notebook will result in the following error when running the training section

Traceback (most recent call last):
  File "/content/diffusers/examples/research_projects/sd3_lora_colab/train_dreambooth_lora_sd3_miniature.py", line 1147, in <module>
    main(args)
  File "/content/diffusers/examples/research_projects/sd3_lora_colab/train_dreambooth_lora_sd3_miniature.py", line 848, in main
    train_dataset = DreamBoothDataset(
  File "/content/diffusers/examples/research_projects/sd3_lora_colab/train_dreambooth_lora_sd3_miniature.py", line 521, in __init__
    instance_images = [Image.open(path) for path in list(Path(instance_data_root).iterdir())]
  File "/content/diffusers/examples/research_projects/sd3_lora_colab/train_dreambooth_lora_sd3_miniature.py", line 521, in <listcomp>
    instance_images = [Image.open(path) for path in list(Path(instance_data_root).iterdir())]
  File "/usr/local/lib/python3.10/dist-packages/PIL/Image.py", line 3431, in open
    fp = builtins.open(filename, "rb")
IsADirectoryError: [Errno 21] Is a directory: '/content/diffusers/examples/research_projects/sd3_lora_colab/dog/.cache'
Traceback (most recent call last):
  File "/usr/local/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/accelerate/commands/accelerate_cli.py", line 48, in main
    args.func(args)
  File "/usr/local/lib/python3.10/dist-packages/accelerate/commands/launch.py", line 1168, in launch_command
    simple_launcher(args)
  File "/usr/local/lib/python3.10/dist-packages/accelerate/commands/launch.py", line 763, in simple_launcher
    raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', 'train_dreambooth_lora_sd3_miniature.py', '--pretrained_model_name_or_path=stabilityai/stable-diffusion-3-medium-diffusers', '--instance_data_dir=dog', '--data_df_path=sample_embeddings.parquet', '--output_dir=trained-sd3-lora-miniature', '--mixed_precision=fp16', '--instance_prompt=a photo of sks dog', '--resolution=1024', '--train_batch_size=1', '--gradient_accumulation_steps=4', '--gradient_checkpointing', '--use_8bit_adam', '--learning_rate=1e-4', '--report_to=wandb', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--max_train_steps=500', '--seed=0']' returned non-zero exit status 1.

It seems like this line is outdated

!rm -rf dog/.huggingface

It should be instead

!rm -rf dog/.cache

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Hi @sayakpaul can you please take a look at my pull request thanks

fix IsADirectoryError when running the training code
@alaister123 alaister123 changed the title Add files via upload fix IsADirectoryError when running the training code Oct 10, 2024
@alaister123 alaister123 reopened this Oct 10, 2024
@alaister123 alaister123 changed the title fix IsADirectoryError when running the training code fix IsADirectoryError when running the training code for sd3_dreambooth_lora_16gb.ipynb Oct 10, 2024
Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sayakpaul
Copy link
Member

Failing tests are unrelated.

@sayakpaul sayakpaul merged commit 164ec9f into huggingface:main Oct 11, 2024
1 check failed
sayakpaul pushed a commit that referenced this pull request Dec 23, 2024
…th_lora_16gb.ipynb (#9634)

Add files via upload

fix IsADirectoryError when running the training code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants