Skip to content

Conv2d.forward() takes 2 positional arguments but 3 were given #1037

@hoang1007

Description

@hoang1007

System Info

peft==0.6.0dev
diffusers==0.21.4

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder
  • My own task or dataset (give details below)

Reproduction

Sorry, but I don't know how to provide a simple code snippet because it's happend when I training diffusion. It require several steps like prepare data, training code...

LORA_TARGET_MODULES = [
        "to_q",
        "to_k",
        "to_v",
        "proj",
        "proj_in",
        "proj_out",
        "conv",
        "conv1",
        "conv2",
        "conv_shortcut",
        "to_out.0",
        "time_emb_proj",
        "ff.net.2",
    ]

unet = get_peft_model(
  model=unet,
  peft_config=LoraConfig(
      target_modules=LORA_TARGET_MODULES,
  )
)

Expected behavior

I think the reason is:

  • ResnetBlock2D used in Unet module has conv1 layer as type LoRACompatibleConv and it take 2 arguments
    Screenshot from 2023-10-19 10-22-13
  • But when I passed unet into get_peft_model(). the conv1 layer has changed to type peft.tuners.lora.layer.Conv2d and it take only 1 argument
    Screenshot from 2023-10-19 10-25-52

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions