d8ahazard / sd_dreambooth_extension

Other
1.85k stars 283 forks source link

Error al cargar sd_dreambooth_extension en Windows 10: 'LoRAAttnProcessor2_0' no definido #1464

Closed RamNetSec closed 2 months ago

RamNetSec commented 4 months ago

Is there an existing issue for this?

What happened?

Al intentar usar la extensión sd_dreambooth_extension con Stable Diffusion WebUI versión 1.8.0-RC en Windows 10, se produce un error durante la inicialización del módulo diffusers.models.unets.unet_2d_condition. El sistema no puede encontrar la definición para LoRAAttnProcessor2_0, lo que resulta en una excepción NameError.

Steps to reproduce the problem

Instalar Stable Diffusion WebUI versión 1.8.0-RC en un entorno de Windows 10. Añadir la extensión sd_dreambooth_extension siguiendo las instrucciones de instalación proporcionadas. Ejecutar Stable Diffusion WebUI. Observar el error durante la carga de scripts relacionados con sd_dreambooth_extension.

Commit and libraries

Starting at Initializing Dreambooth and ending several lines below at [+] bitsandbytes version 0.35.4 installed..

Command Line Arguments

No

Console logs

PS F:\stable-diffusion-webui-1.8.0-RC> .\webui-user.bat
venv "F:\stable-diffusion-webui-1.8.0-RC\venv\Scripts\Python.exe"
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: 1.8.0-RC
Commit hash:
Installing requirements
bin F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda121.dll
If submitting an issue on github, please provide the full startup log for debugging purposes.

Initializing Dreambooth
Dreambooth revision: 30bfbc2
Checking xformers...
Checking bitsandbytes...
Checking bitsandbytes (Windows)
Virtual environment path: F:\stable-diffusion-webui-1.8.0-RC\venv
Checking for F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda111.dll
Found windows BNB DLL F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda111.dll
Checking Dreambooth requirements...
Installed version of accelerate: 0.21.0
[Dreambooth] accelerate v0.21.0 is already installed.
Installed version of dadaptation: 3.2
[Dreambooth] dadaptation v3.2 is already installed.
Installed version of diffusers: 0.26.3
[Dreambooth] diffusers v0.25.0 is already installed.
Installed version of discord-webhook: 1.3.0
[Dreambooth] discord-webhook v1.3.0 is already installed.
Installed version of fastapi: 0.94.0
[Dreambooth] fastapi is already installed.
Installed version of gitpython: 3.1.32
[Dreambooth] gitpython v3.1.40 is not installed.
Successfully installed gitpython-3.1.42

Installed version of pytorch_optimizer: 2.12.0
[Dreambooth] pytorch_optimizer v2.12.0 is already installed.
Installed version of Pillow: 9.5.0
[Dreambooth] Pillow is already installed.
Installed version of tqdm: 4.66.2
[Dreambooth] tqdm is already installed.
Installed version of tomesd: 0.1.3
[Dreambooth] tomesd v0.1.2 is already installed.
Installed version of tensorboard: 2.13.0
[Dreambooth] tensorboard v2.13.0 is already installed.
[+] torch version 2.1.2+cu121 installed.
[+] torchvision version 0.16.2+cu121 installed.
[+] accelerate version 0.21.0 installed.
[+] diffusers version 0.26.3 installed.
[+] bitsandbytes version 0.41.2.post2 installed.
[+] xformers version 0.0.23.post1 installed.
Launching Web UI with arguments: --xformers
bin F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\bitsandbytes\libbitsandbytes_cuda121.dll
Loading weights [6ce0161689] from F:\stable-diffusion-webui-1.8.0-RC\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: F:\stable-diffusion-webui-1.8.0-RC\configs\v1-inference.yaml
Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch().
Startup time: 25.5s (prepare environment: 15.1s, import torch: 3.6s, import gradio: 0.9s, setup paths: 1.8s, initialize shared: 1.3s, other imports: 0.3s, load scripts: 1.5s, create ui: 0.5s, gradio launch: 0.5s).
Applying attention optimization: xformers... done.
Advanced elements visible: False
Model loaded in 4.6s (load weights from disk: 0.3s, create model: 0.7s, apply weights to model: 2.3s, calculate empty prompt: 1.2s).
Custom model name is ramnetsec
Initializing dreambooth training...
WARNING:dreambooth.train_dreambooth:Wandb API key not set. Please set WANDB_API_KEY environment variable to use wandb.
Loading latent cache...
9 cached latentss]
F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\loaders\lora.py:805: FutureWarning: _modify_text_encoder is deprecated and will be removed in version 0.27. You are using an old version of LoRA backend. This will be deprecated in the next releases in favor of PEFT make sure to install the latest PEFT and transformers packages in the future.
deprecate("_modify_text_encoder", "0.27", LORA_DEPRECATION_MESSAGE)
F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\loaders\lora.py:777: FutureWarning: _remove_text_encoder_monkey_patch_classmethod is deprecated and will be removed in version 0.27. You are using an old version of LoRA backend. This will be deprecated in the next releases in favor of PEFT make sure to install the latest PEFT and transformers packages in the future.
deprecate("_remove_text_encoder_monkey_patch_classmethod", "0.27", LORA_DEPRECATION_MESSAGE)
Init dataset!set: 0%| | 0/1 [00:00<?, ?it/s]
Preparing Dataset (With Caching)
Bucket 0 (512, 512, 0) - Instance Images: 9 | Class Images: 0 | Max Examples/batch: 9
Total Buckets 1 - Instance Images: 9 | Class Images: 0 | Max Examples/batch: 9

Total images / batch: 9, total examples: 9█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<?, ?it/s]
Initializing bucket counter!
Steps: 0%| | 0/5409 [00:00<?, ?it/s]Traceback (most recent call last):
File "F:\stable-diffusion-webui-1.8.0-RC\extensions\sd_dreambooth_extension\dreambooth\ui_functions.py", line 735, in start_training
result = main(class_gen_method=class_gen_method)
File "F:\stable-diffusion-webui-1.8.0-RC\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 2003, in main
return inner_loop()
File "F:\stable-diffusion-webui-1.8.0-RC\extensions\sd_dreambooth_extension\dreambooth\memory.py", line 126, in decorator
return function(batch_size, grad_size, prof, *args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\extensions\sd_dreambooth_extension\dreambooth\train_dreambooth.py", line 1745, in inner_loop
model_pred = unet(noisy_latents, timesteps, encoder_hidden_states).sample
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\accelerate\utils\operations.py", line 581, in forward
return model_forward(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\accelerate\utils\operations.py", line 569, in call
return convert_to_fp32(self.model_forward(*args, **kwargs))
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\amp\autocast_mode.py", line 16, in decorate_autocast
return func(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\unets\unet_2d_condition.py", line 1121, in forward
sample, res_samples = downsample_block(
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\unets\unet_2d_blocks.py", line 1189, in forward
hidden_states = attn(
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\transformers\transformer_2d.py", line 379, in forward
hidden_states = torch.utils.checkpoint.checkpoint(
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch_compile.py", line 24, in inner
return torch._dynamo.disable(fn, recursive)(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch_dynamo\eval_frame.py", line 328, in _fn
return fn(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch_dynamo\external_utils.py", line 17, in inner
return fn(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\utils\checkpoint.py", line 458, in checkpoint
ret = function(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\transformers\transformer_2d.py", line 374, in custom_forward
return module(*inputs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\attention.py", line 335, in forward
attn_output = self.attn1(
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\attention_processor.py", line 512, in forward
return self.processor(
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\models\attention_processor.py", line 1931, in call
deprecate(
File "F:\stable-diffusion-webui-1.8.0-RC\venv\lib\site-packages\diffusers\utils\deprecation_utils.py", line 18, in deprecate
raise ValueError(
ValueError: The deprecation tuple ('LoRAAttnProcessor2_0', '0.26.0', 'Make sure use AttnProcessor2_0 instead by settingLoRA layers to self.{to_q,to_k,to_v,to_out[0]}.lora_layer respectively. This will be done automatically when using LoraLoaderMixin.load_lora_weights') should be removed since diffusers' version 0.26.3 is >= 0.26.0

Additional information

No response

github-actions[bot] commented 3 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