Skip to content

Commit

Permalink
Merge pull request #8 from kohya-ss/dev
Browse files Browse the repository at this point in the history
Fix text encoder training is not stopped #4. closes #4
  • Loading branch information
kohya-ss authored Dec 22, 2022
2 parents 689c841 + 0a884da commit d904bb7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions train_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ def _unscale_grads_replacer(optimizer, inv_scale, found_inf, allow_fp16):
if stop_text_encoder_training:
print(f"stop text encoder training at step {global_step}")
text_encoder.train(False)
text_encoder.requires_grad_(False)

with accelerator.accumulate(unet):
with torch.no_grad():
Expand Down

0 comments on commit d904bb7

Please sign in to comment.