Closed Xonxt closed 1 year ago
@Xonxt hello,
Thank you for the detailed description and carefully logging the issue. We appreciate your efforts to debug the problem.
The error you're talking about tends to occur when two types of image augmentations - in this case, mixup
and mosaic
- are applied simultaneously with probabilities that are neither 0 nor 1 but lie between them. At this juncture, it seems like the DataLoader is attempting to stack tuples rather than Tensor objects, leading to the TypeError you've reported.
This situation happens due to the fundamental differences between Mixup and Mosaic techniques. While Mixup creates a blend of two randomly chosen images, Mosaic takes four images and stitches them into a single one. Therefore, using both concurrently might result in conflicting data structure expectations, causing the crash.
Comprehensive testing and debugging are needed to fix this error. As of now, a typical workaround would be to avoid such simultaneous use or to ensure at least one of their probabilities is set to 0.
The Ultralytics team will review this issue and consider the necessary enhancements in the subsequent updates of the YOLOv8 model. As always, we value our community's feedback and appreciate your input.
Please continue to monitor our repository for updates and improvements.
Best Regards, Glenn Jocher.
@Xonxt The training with mixup=0.5
and mosaic=0.5
goes fine to me:
๐ Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO ๐ and Vision AI โญ
Search before asking
YOLOv8 Component
Training
Bug
When setting the probabilities of both
mixup
andmosaic
to a value0 < p < 1
, notice the strict "<" here (so, neither 0.0 nor 1.0, but in-between), the detection-training crashes with the following exception:referring of course to the
def collate_fn(batch):
function inultralytics/data/dataset.py
.Example:
Environment
Minimal Reproducible Example
Additional
No response
Are you willing to submit a PR?