From a0b63ee7f4a8c793c0d200c86ef07677aa4cbf2e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 13 Apr 2023 07:14:24 +0200 Subject: Update --- training/strategy/dreambooth.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'training/strategy/dreambooth.py') diff --git a/training/strategy/dreambooth.py b/training/strategy/dreambooth.py index fa51bc7..4ae28b7 100644 --- a/training/strategy/dreambooth.py +++ b/training/strategy/dreambooth.py @@ -142,9 +142,7 @@ def dreambooth_strategy_callbacks( ) pipeline.save_pretrained(checkpoint_output_dir) - del unet_ - del text_encoder_ - del pipeline + del unet_, text_encoder_, pipeline if torch.cuda.is_available(): torch.cuda.empty_cache() @@ -165,8 +163,7 @@ def dreambooth_strategy_callbacks( unet_.to(dtype=orig_unet_dtype) text_encoder_.to(dtype=orig_text_encoder_dtype) - del unet_ - del text_encoder_ + del unet_, text_encoder_ if torch.cuda.is_available(): torch.cuda.empty_cache() -- cgit v1.2.3-54-g00ecf