-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
where is the shuffle in dataloader? #1919
Comments
@Laughing-q yes shuffle=False by default when training and testing. There are a few threads on this topic, but I believe everything this fine, because 3/4 of the images in each mosaic are shuffled, so in reality 75% of the content is effectively shuffled with the 4-mosaic, or 8/9 if the 9-mosaic is used. |
I see, thanks |
@Laughing-q good news 😃! Your original issue may now be fixed ✅ in PR #5623 by @werner-duvaud. This PR turns on shuffling in the YOLOv5 training DataLoader by default, which was missing until now. This works for all training formats: CPU, Single-GPU, Multi-GPU DDP. train_loader, dataset = create_dataloader(train_path, imgsz, batch_size // WORLD_SIZE, gs, single_cls,
hyp=hyp, augment=True, cache=opt.cache, rect=opt.rect, rank=LOCAL_RANK,
workers=workers, image_weights=opt.image_weights, quad=opt.quad,
prefix=colorstr('train: '), shuffle=True) # <--- NEW I evaluated this PR against master on VOC finetuning for 50 epochs, and the results show a slight improvement in most metrics and losses, particularly in objectness loss and mAP@0.5, perhaps indicating that the shuffle addition may help delay overtraining. https://wandb.ai/glenn-jocher/VOC To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
❔Question
it seems like there is no shuffle when create a dataloader, is this better ? or I just didn't find where shuffle is ?
Additional context
maybe shuffle is not that important when we using mosaic which set default, but shuffle is important when we training without any augment or mosaic.
The text was updated successfully, but these errors were encountered: