yardenfren1996 / B-LoRA

Implicit Style-Content Separation using B-LoRA
MIT License
298 stars 22 forks source link

AttributeError: 'Linear' object has no attribute 'set_lora_layer' #23

Closed Shenrui-Ma closed 2 weeks ago

Shenrui-Ma commented 2 weeks ago

Did anyone met this problem?

Traceback (most recent call last): File "/root/B-LoRA/train_dreambooth_b-lora_sdxl.py", line 2029, in main(args) File "/root/B-LoRA/train_dreambooth_b-lora_sdxl.py", line 1144, in main attn_module.to_q.set_lora_layer( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/B_LoRA/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1931, in getattr raise AttributeError( AttributeError: 'Linear' object has no attribute 'set_lora_layer' Traceback (most recent call last): File "/root/miniconda3/envs/B_LoRA/bin/accelerate", line 8, in sys.exit(main()) ^^^^^^ File "/root/miniconda3/envs/B_LoRA/lib/python3.12/site-packages/accelerate/commands/accelerate_cli.py", line 48, in main args.func(args) File "/root/miniconda3/envs/B_LoRA/lib/python3.12/site-packages/accelerate/commands/launch.py", line 1168, in launch_command simple_launcher(args) File "/root/miniconda3/envs/B_LoRA/lib/python3.12/site-packages/accelerate/commands/launch.py", line 763, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['/root/miniconda3/envs/B_LoRA/bin/python', 'train_dreambooth_b-lora_sdxl.py', '--pretrained_model_name_or_path=stabilityai/stable-diffusion-xl-base-1.0', '--instance_data_dir=/root/B-LoRA/image/Lena/Lena.png', '--output_dir=/root/B-LoRA/loras', '--instance_prompt=A woman', '--resolution=512', '--rank=32', '--train_batch_size=1', '--learning_rate=5e-5', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--max_train_steps=100', '--checkpointing_steps=500', '--seed=0', '--gradient_checkpointing', '--use_8bit_adam', '--mixed_precision=fp16']' returned non-zero exit status 1.

yardenfren1996 commented 2 weeks ago

Hi @Shenrui-Ma , Please ensure you're using diffusers==0.25.0 and avoid using the peft library. Let me know if you still need help with this error.

Shenrui-Ma commented 2 weeks ago

Thanks.I lowered the version of huggingface_hub to 0.24.7 and the problem fixed.