d8ahazard / sd_dreambooth_extension

Other
1.86k stars 282 forks source link

[Bug]: SDXL Lora training with class images, ValueError: not enough values to unpack (expected 2, got 1) #1408

Closed fawolfmann closed 9 months ago

fawolfmann commented 9 months ago

Is there an existing issue for this?

What happened?

When training a Lora Dreambooth with SDXL model and class images i got ValueError: not enough values to unpack (expected 2, got 1).

With instance images and class images a path to them, and prompt of both [filewords], with their captions.

Steps to reproduce the problem

im trying to run a regular training with Lora.

Commit and libraries

Initializing Dreambooth Dreambooth revision: 1cf7267f49ecfe24fec9756b1d76c0ad8629087f Checking xformers... Checking bitsandbytes... Checking bitsandbytes (Linux)

Checking Dreambooth requirements... [Dreambooth] accelerate v0.21.0 is already installed. [Dreambooth] dadaptation v3.1 is already installed. [Dreambooth] diffusers v0.23.1 is already installed. [Dreambooth] discord-webhook v1.3.0 is already installed. [Dreambooth] fastapi is already installed. [Dreambooth] gitpython v3.1.40 is not installed. Successfully installed gitpython-3.1.40 [Dreambooth] pytorch_optimizer v2.12.0 is already installed. [Dreambooth] Pillow is already installed. [Dreambooth] tqdm is already installed. [Dreambooth] tomesd v0.1.2 is already installed. [Dreambooth] transformers v4.30.2 is already installed. [Dreambooth] tensorboard v2.13.0 is already installed. [+] xformers version 0.0.21 installed. [!] torch version 2.0.1 installed. [!] torchvision version 0.15.2 installed. [+] accelerate version 0.21.0 installed. [+] diffusers version 0.23.1 installed. [+] transformers version 4.30.2 installed. [+] bitsandbytes version 0.41.3.post1 installed.

Command Line Arguments

./webui.sh --xformers --port 8080 --enable-insecure-extension-access --listen

Console logs

Traceback: 

Traceback (most recent call last):
  File "/home/azureuser/stable-diffusion/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/ui_functions.py", line 735, in start_training
    result = main(class_gen_method=class_gen_method)
  File "/home/azureuser/stable-diffusion/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/train_dreambooth.py", line 1878, in main
    return inner_loop()
  File "/home/azureuser/stable-diffusion/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/memory.py", line 126, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "/home/azureuser/stable-diffusion/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/train_dreambooth.py", line 1662, in inner_loop
    target, target_prior = torch.chunk(target, 2, dim=0)
ValueError: not enough values to unpack (expected 2, got 1)

Additional information

No response

fawolfmann commented 9 months ago

closing with PR #1410