diff options
author | Volpeon <git@volpeon.ink> | 2023-04-13 07:14:24 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-04-13 07:14:24 +0200 |
commit | a0b63ee7f4a8c793c0d200c86ef07677aa4cbf2e (patch) | |
tree | 6a695b2b5a73cebc35ff9e581c70f1a0e75b62e8 /training/strategy/dreambooth.py | |
parent | Experimental convnext discriminator support (diff) | |
download | textual-inversion-diff-a0b63ee7f4a8c793c0d200c86ef07677aa4cbf2e.tar.gz textual-inversion-diff-a0b63ee7f4a8c793c0d200c86ef07677aa4cbf2e.tar.bz2 textual-inversion-diff-a0b63ee7f4a8c793c0d200c86ef07677aa4cbf2e.zip |
Update
Diffstat (limited to 'training/strategy/dreambooth.py')
-rw-r--r-- | training/strategy/dreambooth.py | 7 |
1 files changed, 2 insertions, 5 deletions
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( | |||
142 | ) | 142 | ) |
143 | pipeline.save_pretrained(checkpoint_output_dir) | 143 | pipeline.save_pretrained(checkpoint_output_dir) |
144 | 144 | ||
145 | del unet_ | 145 | del unet_, text_encoder_, pipeline |
146 | del text_encoder_ | ||
147 | del pipeline | ||
148 | 146 | ||
149 | if torch.cuda.is_available(): | 147 | if torch.cuda.is_available(): |
150 | torch.cuda.empty_cache() | 148 | torch.cuda.empty_cache() |
@@ -165,8 +163,7 @@ def dreambooth_strategy_callbacks( | |||
165 | unet_.to(dtype=orig_unet_dtype) | 163 | unet_.to(dtype=orig_unet_dtype) |
166 | text_encoder_.to(dtype=orig_text_encoder_dtype) | 164 | text_encoder_.to(dtype=orig_text_encoder_dtype) |
167 | 165 | ||
168 | del unet_ | 166 | del unet_, text_encoder_ |
169 | del text_encoder_ | ||
170 | 167 | ||
171 | if torch.cuda.is_available(): | 168 | if torch.cuda.is_available(): |
172 | torch.cuda.empty_cache() | 169 | torch.cuda.empty_cache() |