Skip to content

How to set pipe "requires_grad=true"? #12672

@micklexqg

Description

@micklexqg

I have set the variable and the model "requires_grad=true" with the following:
pipe.transformer.requires_grad = True pipe.vae.requires_grad = True
prev_sample = prev_sample.detach().requires_grad_(True)
but the "requires_grad" of result by the pipe is still not true:
image_tar = pipe.vae.decode(prev_sample, return_dict=False)[0]
"image_tar" still can not requires_grad, so how to set pipe "requires_grad=true"?(all the operation is during inference stage.)

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