From 7c94d386c1f4da582b32e769fdb60c4917828b83 Mon Sep 17 00:00:00 2001 From: DKnight54 <126916963+DKnight54@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:45:30 +0800 Subject: [PATCH] Update train_network.py --- train_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train_network.py b/train_network.py index 4c7d3bf3..a4e7565e 100644 --- a/train_network.py +++ b/train_network.py @@ -913,7 +913,7 @@ class NetworkTrainer: if "latents" in batch and batch["latents"] is not None: latents = batch["latents"].to(accelerator.device).to(dtype=weight_dtype) else: - if args.train_vae_batch is None or len(batch["latents"] <= args.train_vae_batch + if args.train_vae_batch is None or len(batch["latents"]) <= args.train_vae_batch with torch.no_grad(): # latentに変換 latents = vae.encode(batch["images"].to(dtype=vae_dtype)).latent_dist.sample().to(dtype=weight_dtype)