Dreambooth icon indicating copy to clipboard operation
Dreambooth copied to clipboard

Accelerate accumulation context for multiple models not supported yet

Open brian6091 opened this issue 2 years ago • 1 comments
trafficstars

https://github.com/huggingface/accelerate/issues/668

Do this manually?

brian6091 avatar Dec 28 '22 09:12 brian6091

    for step, batch in enumerate(train_dataloader):
        # TODO: how to handle context setting when unet is not training?
        # https://stackoverflow.com/a/14029481
        #train_all = train_unet and train_text_encoder
        #with (accelerator.accumulate(unet), accelerator.accumulate(text_encoder)) if train_all else (accelerator.accumulate(unet) if train_unet else accelerator.accumulate(text_encoder))
        with accelerator.accumulate(unet):

brian6091 avatar Dec 28 '22 13:12 brian6091