-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
AttributeError: 'Linear' object has no attribute 'set_lora_layer' #5919
Comments
Solved after uninstalling peft. |
Likewise. |
Hmm we should not have to uninstall PEFT in order to run our example scripts. cc @sayakpaul @younesbelkada could you take a look here? |
I did a quick search and indeed, there are 3 examples which call
The package code itself looks good though, all instances of |
@patrickvonplaten I had a chance to investigate the problem. We have: In case |
how to fixed this bug , during training lora with script must uninstall peft but during inference , dependence peft ??? It is a big problem for usage |
@johnowhitaker You can try torch.load lora_weights file. Then use pipe.unet.load_attn_procs |
Can we add if-else statements to the example scripts just to make sure? |
Can you elaborate what you mean? |
Like can we make sure that we don't use PEFT in the unet if the example script doesn't use PEFT (even if |
Honestly, I don't think we need to do that because we know that #5388 is going to be merged very very soon. So, any changes will soon become redundant and will need to be removed. |
The old scripts will still be used quite a bit I think. I'm sure that people will go back to use them as they don't want to update all their training scripts to PEFT yet. As it's an easy change I'd be in favor of adding it even if it might be there only for a week |
Hii, I am facing the same issue, It was working good for me till yesterday that is 5/12/2023, and since today it is showing 'set_lora_layer' issue. Any update on this or how to resolve this issue? |
Does the above PR work? |
I checked onto your branch from which the PR is raised and tried running through there. I got the same error.
this is my launch command,
|
Can you shed some light on your environment? Versions, etc.? Do you have peft installed? |
I am running the code on Kaggle notebook with GPU P100 I explicitly too tried installing peft. then too it shows the same error. |
Will investigate. Sorry for the trouble. |
@yashveer08 sorry about the delay. I think you would need to propagate the changes introduced in #6045 to the Also note that with #5388, this won't actually be needed. But we will just keep the PR open for respecting our users as @patrickvonplaten pointed out here: Does that make sense? |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Hi, I am trying to run https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/train_dreambooth_lora_sdxl.py and getting the same error: AttributeError: 'Linear' object has no attribute 'set_lora_layer'. Since a lot of changes have been made since then, can you help me with what versions of diffusers, torch, xformers, torchvision, etc. should I use? I am mostly facing compatibility issues. If there are any changes to be made in the training script, can you mention that as well? I have tried running it with and without PEFT. Thanks! |
You should make sure you are using the latest version of diffusers pulled from the |
Describe the bug
I use (ttps://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_lora.py to train lora and raise an error
AttributeError: Linear' object has no attribute 'set_lora_layer
.Reproduction
training examples/text_to_image/train_text_to_image_lora.py
Logs
No response
System Info
diffusers
version: 0.24.0.dev0Who can help?
@sayakpaul @patrickvonplaten
The text was updated successfully, but these errors were encountered: