glenn-jocher commited on
Commit
abfcf9e
·
unverified ·
1 Parent(s): 25f8ab8

Replace print() with logging.info() in trainloader (#3103)

Browse files

Might indirectly help #3095 by providing better visibility on source of corruption.

Files changed (1) hide show
  1. utils/datasets.py +2 -2
utils/datasets.py CHANGED
@@ -490,14 +490,14 @@ class LoadImagesAndLabels(Dataset): # for training/testing
490
  x[im_file] = [l, shape, segments]
491
  except Exception as e:
492
  nc += 1
493
- print(f'{prefix}WARNING: Ignoring corrupted image and/or label {im_file}: {e}')
494
 
495
  pbar.desc = f"{prefix}Scanning '{path.parent / path.stem}' images and labels... " \
496
  f"{nf} found, {nm} missing, {ne} empty, {nc} corrupted"
497
  pbar.close()
498
 
499
  if nf == 0:
500
- print(f'{prefix}WARNING: No labels found in {path}. See {help_url}')
501
 
502
  x['hash'] = get_hash(self.label_files + self.img_files)
503
  x['results'] = nf, nm, ne, nc, i + 1
 
490
  x[im_file] = [l, shape, segments]
491
  except Exception as e:
492
  nc += 1
493
+ logging.info(f'{prefix}WARNING: Ignoring corrupted image and/or label {im_file}: {e}')
494
 
495
  pbar.desc = f"{prefix}Scanning '{path.parent / path.stem}' images and labels... " \
496
  f"{nf} found, {nm} missing, {ne} empty, {nc} corrupted"
497
  pbar.close()
498
 
499
  if nf == 0:
500
+ logging.info(f'{prefix}WARNING: No labels found in {path}. See {help_url}')
501
 
502
  x['hash'] = get_hash(self.label_files + self.img_files)
503
  x['results'] = nf, nm, ne, nc, i + 1