mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-15 00:32:25 +00:00
Move batch size syncing outside validation
This commit is contained in:
@@ -1566,9 +1566,6 @@ class NetworkTrainer:
|
||||
}
|
||||
self.step_logging(accelerator, logs, global_step, epoch=epoch + 1)
|
||||
|
||||
if accelerator.sync_gradients:
|
||||
batch_size = 0 # reset batch size
|
||||
|
||||
restore_rng_state(rng_states)
|
||||
args.min_timestep = original_args_min_timestep
|
||||
args.max_timestep = original_args_max_timestep
|
||||
@@ -1576,6 +1573,9 @@ class NetworkTrainer:
|
||||
accelerator.unwrap_model(network).train()
|
||||
progress_bar.unpause()
|
||||
|
||||
if accelerator.sync_gradients:
|
||||
batch_size = 0 # reset batch size
|
||||
|
||||
if global_step >= args.max_train_steps:
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user