mindspore-lab / mindone

one for all, Optimal generator with No Exception
Apache License 2.0
328 stars 62 forks source link

mindone/examples/diffusers/text_to_image /train_text_to_image.py 冻结可训练参数函数BUG #486

Closed ultranationalism closed 1 month ago

ultranationalism commented 1 month ago
# Freeze vae and text_encoder and set unet to trainable
def freeze_params(m: nn.Cell):
    for p in m.get_parameters():
        p.require_grad = False

应为

Freeze vae and text_encoder and set unet to trainable

def freeze_params(m: nn.Cell):
    for p in m.get_parameters():
        p.requires_grad = False
geniuspatrick commented 1 month ago

fixed in #487