From 963ee05d164192956e1bf3f157ee4da077460f9e Mon Sep 17 00:00:00 2001 From: satani99 <42287151+satani99@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:42:24 +0530 Subject: [PATCH] Update train_dreambooth_lora_sd3.py (#8600) * Update train_dreambooth_lora_sd3.py * Update train_dreambooth_lora_sd3.py * Update train_dreambooth_sd3.py --------- Co-authored-by: Sayak Paul --- examples/dreambooth/train_dreambooth_lora_sd3.py | 1 - examples/dreambooth/train_dreambooth_sd3.py | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/dreambooth/train_dreambooth_lora_sd3.py b/examples/dreambooth/train_dreambooth_lora_sd3.py index 5da947ca3a..6006e54461 100644 --- a/examples/dreambooth/train_dreambooth_lora_sd3.py +++ b/examples/dreambooth/train_dreambooth_lora_sd3.py @@ -1344,7 +1344,6 @@ def main(args): if not train_dataset.custom_instance_prompts: del tokenizers, text_encoders # Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection - del tokenizer_one, tokenizer_two, tokenizer_three del text_encoder_one, text_encoder_two, text_encoder_three gc.collect() if torch.cuda.is_available(): diff --git a/examples/dreambooth/train_dreambooth_sd3.py b/examples/dreambooth/train_dreambooth_sd3.py index c012aebcc0..124d7b48ee 100644 --- a/examples/dreambooth/train_dreambooth_sd3.py +++ b/examples/dreambooth/train_dreambooth_sd3.py @@ -1372,7 +1372,6 @@ def main(args): if not args.train_text_encoder and not train_dataset.custom_instance_prompts: del tokenizers, text_encoders # Explicitly delete the objects as well, otherwise only the lists are deleted and the original references remain, preventing garbage collection - del tokenizer_one, tokenizer_two, tokenizer_three del text_encoder_one, text_encoder_two, text_encoder_three gc.collect() if torch.cuda.is_available():