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/lora.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/lora.py')
-rw-r--r-- | training/strategy/lora.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/training/strategy/lora.py b/training/strategy/lora.py index 73ec8f2..1517ee8 100644 --- a/training/strategy/lora.py +++ b/training/strategy/lora.py | |||
@@ -140,8 +140,7 @@ def lora_strategy_callbacks( | |||
140 | with open(checkpoint_output_dir / "lora_config.json", "w") as f: | 140 | with open(checkpoint_output_dir / "lora_config.json", "w") as f: |
141 | json.dump(lora_config, f) | 141 | json.dump(lora_config, f) |
142 | 142 | ||
143 | del unet_ | 143 | del unet_, text_encoder_ |
144 | del text_encoder_ | ||
145 | 144 | ||
146 | if torch.cuda.is_available(): | 145 | if torch.cuda.is_available(): |
147 | torch.cuda.empty_cache() | 146 | torch.cuda.empty_cache() |
@@ -153,8 +152,7 @@ def lora_strategy_callbacks( | |||
153 | 152 | ||
154 | save_samples_(step=step, unet=unet_, text_encoder=text_encoder_) | 153 | save_samples_(step=step, unet=unet_, text_encoder=text_encoder_) |
155 | 154 | ||
156 | del unet_ | 155 | del unet_, text_encoder_ |
157 | del text_encoder_ | ||
158 | 156 | ||
159 | if torch.cuda.is_available(): | 157 | if torch.cuda.is_available(): |
160 | torch.cuda.empty_cache() | 158 | torch.cuda.empty_cache() |