Fixed dataloader CPU bottleneck for small batch sizes (#7659)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
ExtReMLapin 2024-01-19 16:49:54 +01:00 committed by GitHub
parent 7a39ecd0d3
commit c267bd3a0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View file

@ -332,10 +332,7 @@ class BaseTrainer:
f'Image sizes {self.args.imgsz} train, {self.args.imgsz} val\n'
f'Using {self.train_loader.num_workers * (world_size or 1)} dataloader workers\n'
f"Logging results to {colorstr('bold', self.save_dir)}\n"
f'Starting training for '
f'{self.args.time} hours...'
if self.args.time
else f"{self.epochs} epochs..."
f'Starting training for ' + (f"{self.args.time} hours..." if self.args.time else f"{self.epochs} epochs...")
)
if self.args.close_mosaic:
base_idx = (self.epochs - self.args.close_mosaic) * nb