diff options
author | Volpeon <git@volpeon.ink> | 2023-04-10 13:42:50 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2023-04-10 13:42:50 +0200 |
commit | cda7eba710dfde7b2e67964bcf76cd410c6a4a63 (patch) | |
tree | 7fa63edba444d4c8f05e8ef8bc66ca32fbb86bbc /training/strategy/dreambooth.py | |
parent | Fix sample gen: models sometimes weren't in eval mode (diff) | |
download | textual-inversion-diff-cda7eba710dfde7b2e67964bcf76cd410c6a4a63.tar.gz textual-inversion-diff-cda7eba710dfde7b2e67964bcf76cd410c6a4a63.tar.bz2 textual-inversion-diff-cda7eba710dfde7b2e67964bcf76cd410c6a4a63.zip |
Update
Diffstat (limited to 'training/strategy/dreambooth.py')
-rw-r--r-- | training/strategy/dreambooth.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/training/strategy/dreambooth.py b/training/strategy/dreambooth.py index 7cdfc7f..fa51bc7 100644 --- a/training/strategy/dreambooth.py +++ b/training/strategy/dreambooth.py | |||
@@ -149,7 +149,7 @@ def dreambooth_strategy_callbacks( | |||
149 | if torch.cuda.is_available(): | 149 | if torch.cuda.is_available(): |
150 | torch.cuda.empty_cache() | 150 | torch.cuda.empty_cache() |
151 | 151 | ||
152 | @on_eval() | 152 | @torch.no_grad() |
153 | def on_sample(step): | 153 | def on_sample(step): |
154 | unet_ = accelerator.unwrap_model(unet, keep_fp32_wrapper=True) | 154 | unet_ = accelerator.unwrap_model(unet, keep_fp32_wrapper=True) |
155 | text_encoder_ = accelerator.unwrap_model(text_encoder, keep_fp32_wrapper=True) | 155 | text_encoder_ = accelerator.unwrap_model(text_encoder, keep_fp32_wrapper=True) |