From 0a884da9845b1b2a4144b1f360f6c00ca04bf744 Mon Sep 17 00:00:00 2001 From: Kohya S Date: Thu, 22 Dec 2022 23:34:51 +0900 Subject: [PATCH] Fix text encoder training is not stopped #4 --- train_db.py | 1 + 1 file changed, 1 insertion(+) diff --git a/train_db.py b/train_db.py index 9ae6c8ca..b6d11d8d 100644 --- a/train_db.py +++ b/train_db.py @@ -1011,6 +1011,7 @@ def train(args): 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():