Skip to content

Commit

Permalink
Update: Replace images.shape[0] to batch_size.
Browse files Browse the repository at this point in the history
  • Loading branch information
chairc committed Sep 20, 2024
1 parent 95f4bf1 commit 595f912
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def train(rank=None, args=None):
# Enable visualization
if vis:
# images.shape[0] is the number of images in the current batch
n = num_vis if num_vis > 0 else images.shape[0]
n = num_vis if num_vis > 0 else batch_size
sampled_images = diffusion.sample(model=model, n=n)
save_images(images=sampled_images,
path=os.path.join(results_vis_dir, f"{save_name}.{image_format}"))
Expand Down

0 comments on commit 595f912

Please sign in to comment.