Disable `pbar` for DDP ranks > 0 (#7440)

pull/7263/merge
Glenn Jocher 2022-04-16 15:12:38 +02:00 committed by GitHub
parent 3eefab1bb1
commit c9a3b14a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -522,7 +522,7 @@ class LoadImagesAndLabels(Dataset):
self.im_hw0, self.im_hw = [None] * n, [None] * n self.im_hw0, self.im_hw = [None] * n, [None] * n
fcn = self.cache_images_to_disk if cache_images == 'disk' else self.load_image fcn = self.cache_images_to_disk if cache_images == 'disk' else self.load_image
results = ThreadPool(NUM_THREADS).imap(fcn, range(n)) 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: for i, x in pbar:
if cache_images == 'disk': if cache_images == 'disk':
gb += self.npy_files[i].stat().st_size gb += self.npy_files[i].stat().st_size