Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is evolve param? #787

Closed
chokyungjin opened this issue Aug 19, 2020 · 10 comments
Closed

What is evolve param? #787

chokyungjin opened this issue Aug 19, 2020 · 10 comments
Labels
question Further information is requested Stale Stale and schedule for closing soon

Comments

@chokyungjin
Copy link

chokyungjin commented Aug 19, 2020

I'm sooooo happy to use your YOLOv5.
I'm training my custom data using YOLOv5 And I applied evolve parameter,
but it is not over for seven hours.
When I turned this param off, it was over in three hours.
And Model is not saving pt.

What is evolve param? Thanks again!!!!

@chokyungjin chokyungjin added the question Further information is requested label Aug 19, 2020
@chokyungjin chokyungjin reopened this Aug 19, 2020
@glenn-jocher
Copy link
Member

glenn-jocher commented Aug 19, 2020

@chokyungjin evolving hyperparameters is seperate from training, and takes much longer (can take weeks or months on a single GPU). See evolution tutorial: https://docs.ultralytics.com/yolov5

@chokyungjin
Copy link
Author

@glenn-jocher Thanks again.
But I have a another issue. My Train curve is weird in results.jpg.
I don't know why I'm getting the results like this, except I changed my custom data.

my opt is batch 80 img 416 epochs 300 weights '' augmentation default.

image

@glenn-jocher
Copy link
Member

@chokyungjin your val data may not have been found correctly. Make sure your paths appear, and make sure your test_batch0_gt.jpg appears correct.

@chokyungjin
Copy link
Author

@glenn-jocher My test_batch0_gt.jpg appears correct.
So what am I supposed to do now?
I only revise augmentation meta code and iOU threshold value.

Thanks.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Stale and schedule for closing soon label Sep 23, 2020
@maloyan
Copy link

maloyan commented Dec 22, 2021

@chokyungjin Did you manage to resolve that problem?

@glenn-jocher
Copy link
Member

glenn-jocher commented Dec 23, 2021

@maloyan see YOLOv5 Hyperparameter Evolution tutorial:

YOLOv5 Tutorials

Good luck 🍀 and let us know if you have any other questions!

@MLDavies
Copy link

Is it possible to evolve on a subset of hyperparameters? If so, how would this been done?

@glenn-jocher
Copy link
Member

@MLDavies update meta dict here by setting mutation scale to zero for any hyperparams you want to fix in place:

yolov5/train.py

Lines 569 to 600 in 014acde

# Hyperparameter evolution metadata (mutation scale 0-1, lower_limit, upper_limit)
meta = {
'lr0': (1, 1e-5, 1e-1), # initial learning rate (SGD=1E-2, Adam=1E-3)
'lrf': (1, 0.01, 1.0), # final OneCycleLR learning rate (lr0 * lrf)
'momentum': (0.3, 0.6, 0.98), # SGD momentum/Adam beta1
'weight_decay': (1, 0.0, 0.001), # optimizer weight decay
'warmup_epochs': (1, 0.0, 5.0), # warmup epochs (fractions ok)
'warmup_momentum': (1, 0.0, 0.95), # warmup initial momentum
'warmup_bias_lr': (1, 0.0, 0.2), # warmup initial bias lr
'box': (1, 0.02, 0.2), # box loss gain
'cls': (1, 0.2, 4.0), # cls loss gain
'cls_pw': (1, 0.5, 2.0), # cls BCELoss positive_weight
'obj': (1, 0.2, 4.0), # obj loss gain (scale with pixels)
'obj_pw': (1, 0.5, 2.0), # obj BCELoss positive_weight
'iou_t': (0, 0.1, 0.7), # IoU training threshold
'anchor_t': (1, 2.0, 8.0), # anchor-multiple threshold
'anchors': (2, 2.0, 10.0), # anchors per output grid (0 to ignore)
'fl_gamma': (0, 0.0, 2.0), # focal loss gamma (efficientDet default gamma=1.5)
'hsv_h': (1, 0.0, 0.1), # image HSV-Hue augmentation (fraction)
'hsv_s': (1, 0.0, 0.9), # image HSV-Saturation augmentation (fraction)
'hsv_v': (1, 0.0, 0.9), # image HSV-Value augmentation (fraction)
'degrees': (1, 0.0, 45.0), # image rotation (+/- deg)
'translate': (1, 0.0, 0.9), # image translation (+/- fraction)
'scale': (1, 0.0, 0.9), # image scale (+/- gain)
'shear': (1, 0.0, 10.0), # image shear (+/- deg)
'perspective': (0, 0.0, 0.001), # image perspective (+/- fraction), range 0-0.001
'flipud': (1, 0.0, 1.0), # image flip up-down (probability)
'fliplr': (0, 0.0, 1.0), # image flip left-right (probability)
'mosaic': (1, 0.0, 1.0), # image mixup (probability)
'mixup': (1, 0.0, 1.0), # image mixup (probability)
'copy_paste': (1, 0.0, 1.0)} # segment copy-paste (probability)

@MLDavies
Copy link

Ah. Perfect. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale Stale and schedule for closing soon
Projects
None yet
Development

No branches or pull requests

4 participants