Update train_network.py

This commit is contained in:
DKnight54
2025-05-22 18:21:19 +08:00
committed by GitHub
parent 93ce543434
commit 115b1d0aa7

View File

@@ -1096,6 +1096,7 @@ class NetworkTrainer:
train_util.save_and_remove_state_on_epoch_end(args, accelerator, epoch + 1)
if args.sample_every_n_epochs is not None and (epoch + 1)% args.sample_every_n_epochs == 0:
accelerator.wait_for_everyone()
self.sample_images(accelerator, args, epoch + 1, global_step, accelerator.device, vae, tokenizer, text_encoder, unet, example_tuple)
# end of epoch