Closed baleris closed 3 years ago
👋 Hello @baleris, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.
For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.
Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:
$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.
@baleris 👋 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 project/name
directory, typically yolov5/runs/train/exp
.
We've put together a full guide for users looking to get the best results on their YOLOv5 trainings below.
Larger 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.
--weights
argument. Models download automatically from the latest YOLOv5 release.
python train.py --data custom.yaml --weights yolov5s.pt
yolov5m.pt
yolov5l.pt
yolov5x.pt
custom_pretrained.pt
--weights ''
argument:
python train.py --data custom.yaml --weights '' --cfg yolov5s.yaml
yolov5m.yaml
yolov5l.yaml
yolov5x.yaml
Before 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.
--img 640
, though due to the high amount of small objects in the dataset it can benefit from training at higher resolutions such as --img 1280
. If there are many small objects then custom datasets will benefit from training at native or higher resolution. Best inference results are obtained at the same --img
as the training was run at, i.e. if you train at --img 1280
you should also test and detect at --img 1280
.--batch-size
that your hardware allows for. Small batch sizes produce poor batchnorm statistics and should be avoided.hyp['obj']
will help reduce overfitting in those specific loss components. For an automated method of optimizing these hyperparameters, see our Hyperparameter Evolution Tutorial.If 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/
@glenn-jocher i have uploaded my result.jpg, confusion matrix and all references here... could you able to provide me the suggestions here?
I have recently faced the same problem. My custom data set has 2 categories. The number of markings used for training is 700 use two GPU training results curve change very much.
There is a suggestion that I hope to help you: Use Yolov5L6 and try the super-parameters evolution, the effect on my data set is much better than Yolov5s.
I have recently faced the same problem. My custom data set has 2 categories. The number of markings used for training is 700 use two GPU training results curve change very much.
@qingyuan-JLAU means your training data contains 700 images ?
There is a suggestion that I hope to help you: Use Yolov5L6 and try the super-parameters evolution, the effect on my data set is much better than Yolov5s.
@qingyuan-JLAU Does Yolov5L6 needs GPU power to train or it can be trained over CPU ? and how i can perform super-parameter evolution..
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.
Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
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 YOLOv5 🚀 and Vision AI ⭐!
I am trying to train YOLOv5 for my custom dataset. My custom dataset has 5 categories and labelled images for training are in number of 350. Followed instructions provided in custom training. I am using optimized CPU(not GPU). I have couple of questions here: 1) I see lot of variations in mAP value while training, it varies from 0.006 to 0.1 in each alternate epoch. What would be reason for this drastic variation. If data is over fitting, i couldn't see variation in train validation. 2) when i performed inference over test dataset i observed that the bounding box of detected object is not accurate, its either drawn slight right or slightly left or leaves some area of the object. my input data images are of in dimension 2550x3301 of 300dpi. training: _python train.py --img 416 --batch 16 --epochs 100 --data /my/data/path/data.yaml --cfg ./models/yolov5s.yaml --weights ' ' --name yolov5sresults --cache'
infurence: _python detect.py --weights runs/train/yolov5sresults/weights/best.pt --img 416 --conf 0.4 --source ../test/images
Additional context