stable-diffusion icon indicating copy to clipboard operation
stable-diffusion copied to clipboard

when I freeze some layer in UNet I saw the following error.

Open lingtengqiu opened this issue 10 months ago • 0 comments

I add some code in ddpm to freeze crossattention layer like following:

       if without_crossattn:                                                                                                                                                                                                                                                       
            for m in self.modules():                                                                                                                                                                                                                                                
                if isinstance(m, CrossAttention):                                                                                                                                                                                                                                   
                    for para in m.parameters():                                                                                                                                                                                                                                     
                        para.requires_grad=False   

and I face the following error. One of the differentiated Tensors does not require grad error

lingtengqiu avatar Aug 11 '23 12:08 lingtengqiu