Replies: 1 comment 1 reply
-
@haimat 👋 Hello! Thanks for asking about improving YOLOv5 🚀 training results. Most of the time good results can be obtained with no changes to the models or training settings, provided your dataset is sufficiently large and well labelled. If at first you don't get good results, there are steps you might be able to take to improve, but we always recommend users first train with all default settings before considering any changes. This helps establish a performance baseline and spot areas for improvement. If you have questions about your training results we recommend you provide the maximum amount of information possible if you expect a helpful response, including results plots (train losses, val losses, P, R, mAP), PR curve, confusion matrix, training mosaics, test results and dataset statistics images such as labels.png. All of these are located in your We've put together a full guide for users looking to get the best results on their YOLOv5 trainings below. Dataset
Model SelectionLarger models like YOLOv5x and YOLOv5x6 will produce better results in nearly all cases, but have more parameters, require more CUDA memory to train, and are slower to run. For mobile deployments we recommend YOLOv5s/m, for cloud deployments we recommend YOLOv5l/x. See our README table for a full comparison of all models.
python train.py --data custom.yaml --weights yolov5s.pt
yolov5m.pt
yolov5l.pt
yolov5x.pt
custom_pretrained.pt
python train.py --data custom.yaml --weights '' --cfg yolov5s.yaml
yolov5m.yaml
yolov5l.yaml
yolov5x.yaml Training SettingsBefore modifying anything, first train with default settings to establish a performance baseline. A full list of train.py settings can be found in the train.py argparser.
Further ReadingIf you'd like to know more a good place to start is Karpathy's 'Recipe for Training Neural Networks', which has great ideas for training that apply broadly across all ML domains: http://karpathy.github.io/2019/04/25/recipe/ Good luck 🍀 and let us know if you have any other questions! |
Beta Was this translation helpful? Give feedback.
-
I have trained YOLOv5 models on various custom datasets in the past, and all resulting models had quite a good performance, with a test mAP@0.5 of 0.9 or even more. Now I have a new dataset, trained a YOLOv5 model on it, but even after 500 training epoochs I only got a test mAP@0.5 of around 0.5. I tried with different hyperparams, but they led only to minor changes in the model performance.
Now I know that this question does very much depend on the dataset / images, their labels, and so on. There is no single approach to tackle this problem. But still, is there some kind of "best practice" approach, typical things to try if training does not end in a good model?
Since my other datasets led to solid and well-performing models, I assume it is a data problem, not an issue with the YOLOv5 framework. So my question is: How can I identify what the problem with this particular dataset might be when it comes to training a YOLOv5 model?
Beta Was this translation helpful? Give feedback.
All reactions