d8ahazard / sd_dreambooth_extension

Other
1.85k stars 283 forks source link

[Bug]: Dreambooth can not start training #1475

Closed doubtfire009 closed 1 month ago

doubtfire009 commented 2 months ago

Is there an existing issue for this?

What happened?

I use the Stable-Diffusion-webui to train my own pics. But the dreambooth fails to start training.

Steps to reproduce the problem

  1. I first create a new model
  2. Fill all the parameters
  3. Click the train button to train.

Commit and libraries

I start in the Stable Diffusion Webui

Command Line Arguments

No

Console logs

Initializing dreambooth training...
WARNING:dreambooth.train_dreambooth:Wandb API key not set. Please set WANDB_API_KEY environment variable to use wandb.
0 cached latents
Traceback (most recent call last):
  File "D:\JD_projects\sd-webui-aki-v4.7\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 735, in start_training
    result = main(class_gen_method=class_gen_method)
  File "D:\JD_projects\sd-webui-aki-v4.7\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 2003, in main
    return inner_loop()
  File "D:\JD_projects\sd-webui-aki-v4.7\extensions\sd_dreambooth_extension\dreambooth\memory.py", line 126, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "D:\JD_projects\sd-webui-aki-v4.7\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 639, in inner_loop
    text_encoder_lora_params = LoraLoaderMixin._modify_text_encoder(
AttributeError: type object 'LoraLoaderMixin' has no attribute '_modify_text_encoder'

Additional information

No response

Angel113110 commented 2 months ago

how to solve this problem?

doubtfire009 commented 2 months ago

I solved the issue by using diffusers==0.25.0 in requirements, which uses diffusers>=0.25.0. image

I was enlightened by the log: https://www.kaggle.com/code/aisuko/using-civitai-checkpoints-lora-with-diffusers

image

Because the diffusers>=0.25.0 will remove the function _modify_text_encoder. So I suggest the author need to update the codes.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 14 days with no activity. Remove stale label or comment or this will be closed in 30 days