Skip to content

Commit

Permalink
Fix validate_every_n_steps for gradient accumulation
Browse files Browse the repository at this point in the history
  • Loading branch information
rockerBOO committed Jan 12, 2025
1 parent 0456858 commit ee9265c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ def remove_model(old_ckpt_name):
and global_step != 0 # Skip first step
and global_step % args.validate_every_n_steps == 0
)
if validation_steps > 0 and should_validate_step:
if accelerator.sync_gradients and validation_steps > 0 and should_validate_step:
accelerator.print("Validating バリデーション処理...")

val_progress_bar = tqdm(
Expand Down

0 comments on commit ee9265c

Please sign in to comment.