YoloV5 model accuracy issue #5676
Replies: 1 comment 2 replies
-
@Sreekanth-aa 👋 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: |
Beta Was this translation helpful? Give feedback.
-
Hi,.
We are using Yolov5 for object detection. We have 294 images and 4 classes, when we try to train Yolov5l with batch size of >20 and Yolov5x with batch size of >10 the models are not able to train as the process is getting killed. The models are trained in Google colab with RAM size of 12Gb. We would like to know what should be the max RAM size required for Yolov5 model for training if we need to increase the batch size.
We were able to train the Yolov5m with custom dataset (294 images and 4 classes) on colab, when we test the model with --conf 0.1 the model was not able to predict few class images, but with --conf 0.05 the model was able to predict the object but the prediction was wrong. We would like to know how we can increase the accuracy of the model.
Thanks,
Sreekanth
Beta Was this translation helpful? Give feedback.
All reactions