Closed Juanjojr9 closed 2 years ago
@Juanjojr9 we are working on improved documentation, but for the time being you can see the help field in each argument for details. If you have doubts about arguments, always use the default value. https://github.com/ultralytics/yolov5/blob/4c409332667477560200958b513b958bb8fdef71/train.py#L453-L496
For --evolve see Hyperparameter Evolution tutorial below:
Good luck 🍀 and let us know if you have any other questions!
Hello @glenn-jocher, First of all, I would like to thank you for your response.
Currently, I'm doing my final project for graduation using YOLOv5. That's why I'm so interested in learning as much as I can, and in case I am asked by my tutor, to be able to answer in a coherent manner. I have read the help field in each argument, but it is not very detailed.
This is why I would like to know what each parameter does in a short form and I can defend myself
Any help is good.
JJ
@Juanjojr9 thanks for your feedback! We will try to improve the documentation going forward to explain arguments in greater detail. For now the help section is all that is available, and as I said before if you are unsure of an argument then there is no reason to modify it.
@Juanjojr9 also I've added our tips for best training here which explain a few concepts.
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/
Good luck 🍀 and let us know if you have any other questions!
Hello, could you explain what is translate: 0.1 # image translation (+/- fraction) and perspective: 0.0 # image perspective (+/- fraction), range 0-0.001. Does image translate means something what is written in this article Image-to-Image Translation: Methods and Applications https://arxiv.org/pdf/2101.08629.pdf and image perspective is something like https://www.geeksforgeeks.org/perspective-transformation-python-opencv/ ?
@Tautvydas-byte translation left-right or up-down
@glenn-jocher How would you suggest the retraining in the below case? I have trained a model with 30 classes but I had the training data for just 25 classes. Now I have the training data for 5 classes that were not included before. How can I retrain for this using the previously trained model? without using the previous data
@Reynolddoss you must have your previous dataset whether you add or subtract from the first used dataset. You are dealing with the weights, they are updated in each iteration using gradient decent, so if you don't have a dataset of which you are planning to detect objects from, then there is no object in the first place.
Search before asking
Question
Hello.
I tried to look for information about different parameters that can be used in train.py, val.py and detect.py, but I could not find information on some. I have tested activating each parameter, but I can't understand what they are for. Is there an article explaining what each is for?
I would like to understand each of them as well as possible and make the most of them. I am very interested in this topic
I do not know what these parameters are used for, i.e. what their functions are, nor do I know when I should use them. Also I have other questions about some of them
In the train.py file:
In the val.py file:
In the detect.py file:
I hope you can help me to solve this doubt.
Thank you very much for your help.
JJ
Additional
No response