"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "dfcce3ca6ed4cd68246bdf7ee98f1e67b4d252c4"
Unverified Commit 2e69cf16 authored by Vladislav Artemyev's avatar Vladislav Artemyev Committed by GitHub
Browse files

Log global_step instead of epoch to tensorboard (#4493)


Co-authored-by: default avatarmrlzla <noname@noname.com>
parent 9c29bc2d
...@@ -107,7 +107,16 @@ DreamBooth for the text encoder was enabled: {train_text_encoder}. ...@@ -107,7 +107,16 @@ DreamBooth for the text encoder was enabled: {train_text_encoder}.
def log_validation( def log_validation(
text_encoder, tokenizer, unet, vae, args, accelerator, weight_dtype, epoch, prompt_embeds, negative_prompt_embeds text_encoder,
tokenizer,
unet,
vae,
args,
accelerator,
weight_dtype,
global_step,
prompt_embeds,
negative_prompt_embeds,
): ):
logger.info( logger.info(
f"Running validation... \n Generating {args.num_validation_images} images with prompt:" f"Running validation... \n Generating {args.num_validation_images} images with prompt:"
...@@ -173,7 +182,7 @@ def log_validation( ...@@ -173,7 +182,7 @@ def log_validation(
for tracker in accelerator.trackers: for tracker in accelerator.trackers:
if tracker.name == "tensorboard": if tracker.name == "tensorboard":
np_images = np.stack([np.asarray(img) for img in images]) np_images = np.stack([np.asarray(img) for img in images])
tracker.writer.add_images("validation", np_images, epoch, dataformats="NHWC") tracker.writer.add_images("validation", np_images, global_step, dataformats="NHWC")
if tracker.name == "wandb": if tracker.name == "wandb":
tracker.log( tracker.log(
{ {
...@@ -1308,7 +1317,7 @@ def main(args): ...@@ -1308,7 +1317,7 @@ def main(args):
args, args,
accelerator, accelerator,
weight_dtype, weight_dtype,
epoch, global_step,
validation_prompt_encoder_hidden_states, validation_prompt_encoder_hidden_states,
validation_prompt_negative_prompt_embeds, validation_prompt_negative_prompt_embeds,
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment