Skip to content

Commit

Permalink
Update train_network.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DKnight54 authored Feb 2, 2025
1 parent df365c5 commit b3b8563
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions train_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
apply_masked_loss,
)
from library.utils import setup_logging, add_logging_arguments
from accelerate.utils import gather_object
from accelerate.utils import gather_object, gather

setup_logging()
import logging
Expand Down Expand Up @@ -1024,10 +1024,11 @@ def remove_model(old_ckpt_name):

# Checks if the accelerator has performed an optimization step behind the scenes
# Collecting latents and caption lists from all processes
all_latents = gather_object([latents])
logger.info(f"latents.size: {latents.size()} before gather on device {accelerator.state.local_process_index}")
all_latents = gather(latents)
all_captions = gather_object(batch["captions"])
#logger.info(f"latents: {latents}")
#logger.info(f"all_latents: {all_latents}")
logger.info(f"all_latents.size: {all_latents.size()}")
example_tuple = (all_latents, all_captions)
if accelerator.sync_gradients:
progress_bar.update(1)
Expand Down

0 comments on commit b3b8563

Please sign in to comment.