Skip to content
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

RecursionError: maximum recursion depth exceeded while calling a Python object #230

Open
sabetAI opened this issue Apr 19, 2023 · 0 comments

Comments

@sabetAI
Copy link

sabetAI commented Apr 19, 2023

I'm trying to run inject_trainable_lora_extended on a UNet2DConditionModel, with Conv2d as the target module:

from lora_diffusion.lora import inject_trainable_lora_extended


rank = 4
unet = UNet2DConditionModel.from_pretrained("runwayml/stable-diffusion-v1-5", 
                                             subfolder="unet", 
                                             torch_dtype=torch.float16,
                                            )
unet_lora_params, _ = inject_trainable_lora_extended(
    unet,
    target_replace_module=["Conv2d"],
    r=rank,
)
unet_lora_params

I get the following error however: RecursionError: maximum recursion depth exceeded while calling a Python object.

Best to reimplement as a for loop to avoid recursion depth bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant