Disable pbar for DDP ranks > 0 (#7440)

This commit is contained in:
Glenn Jocher authored and GitHub committed 2022-04-16 15:12:38 +02:00
1 parent 3eefab1bb1
commit c9a3b14a74
1 file changed
+1 -1
+1 -1
View File
@@ -522,7 +522,7 @@ class LoadImagesAndLabels(Dataset):
self.im_hw0, self.im_hw = [None] * n, [None] * n
fcn = self.cache_images_to_disk if cache_images == 'disk' else self.load_image
results = ThreadPool(NUM_THREADS).imap(fcn, range(n))
pbar = tqdm(enumerate(results), total=n, bar_format=BAR_FORMAT)
pbar = tqdm(enumerate(results), total=n, bar_format=BAR_FORMAT, disable=LOCAL_RANK > 0)
for i, x in pbar:
if cache_images == 'disk':
gb += self.npy_files[i].stat().st_size