Skip to content

Commit 2be64b3

Browse files
kohya-ssA4P7J1N7M05OT
authored andcommitted
disable main process check for deepspeed kohya-ss#1247
1 parent 95f4c52 commit 2be64b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

train_network.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ def train(self, args):
474474
# before resuming make hook for saving/loading to save/load the network weights only
475475
def save_model_hook(models, weights, output_dir):
476476
# pop weights of other models than network to save only network weights
477-
if accelerator.is_main_process:
477+
# only main process or deepspeed https://github.com/huggingface/diffusers/issues/2606
478+
if accelerator.is_main_process or args.deepspeed:
478479
remove_indices = []
479480
for i, model in enumerate(models):
480481
if not isinstance(model, type(accelerator.unwrap_model(network))):

0 commit comments

Comments
 (0)