Merge pull request #246 from damian0815/patch-2

prevent OOM with disabled unet when gradient checkpointing is enabled
This commit is contained in:
Victor Hall 2024-01-15 20:11:52 -05:00 committed by GitHub
commit 18198715b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -891,7 +891,7 @@ def main(args):
train_dataloader = build_torch_dataloader(train_batch, batch_size=args.batch_size)
unet.train() if not args.disable_unet_training else unet.eval()
unet.train() if (args.gradient_checkpointing or not args.disable_unet_training) else unet.eval()
text_encoder.train() if not args.disable_textenc_training else text_encoder.eval()
logging.info(f" unet device: {unet.device}, precision: {unet.dtype}, training: {unet.training}")