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

Correct mutation adding the missing parameters #11109

Merged
merged 3 commits into from
Mar 9, 2023

Conversation

iker-lluvia
Copy link
Contributor

@iker-lluvia iker-lluvia commented Mar 3, 2023

Correct mutation considering the higher number of segmentation parameters compared to object detection.

Fixes #9730

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Updated hyperparameters mutation logic in YOLOv5 training algorithm.

πŸ“Š Key Changes

  • Changed the index offset from 7 to 12 for accessing hyperparameters values during mutation.
  • Adjusted the keys sent to print_mutation from using all keys to a specific subset (keys 4 to 16).

🎯 Purpose & Impact

  • These changes likely aim to refine the genetic algorithm that mutates hyperparameters for better training performance. 🧬
  • By altering how hyperparameters are mutated, there could be an impact on the efficiency and effectiveness of the model training process. πŸ‹οΈβ€β™‚οΈ
  • Users may experience improved model accuracy or training times due to these optimizations. πŸ”πŸ•’

Correct mutation considering the higher number of segmentation parameters compared to object detection.

Fixes ultralytics#9730

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>
@glenn-jocher
Copy link
Member

@iker-lluvia thanks for the PR. You should not redefine dicts or lists that already exist in YOLOv5. Duplicating code increases maintenance and needlessly grows the codebase. The segmentation keys are here:

KEYS = [
'train/box_loss',
'train/seg_loss', # train loss
'train/obj_loss',
'train/cls_loss',
'metrics/precision(B)',
'metrics/recall(B)',
'metrics/mAP_0.5(B)',
'metrics/mAP_0.5:0.95(B)', # metrics
'metrics/precision(M)',
'metrics/recall(M)',
'metrics/mAP_0.5(M)',
'metrics/mAP_0.5:0.95(M)', # metrics
'val/box_loss',
'val/seg_loss', # val loss
'val/obj_loss',
'val/cls_loss',
'x/lr0',
'x/lr1',
'x/lr2',]

@iker-lluvia
Copy link
Contributor Author

@iker-lluvia thanks for the PR. You should not redefine dicts or lists that already exist in YOLOv5. Duplicating code increases maintenance and needlessly grows the codebase. The segmentation keys are here:

KEYS = [
'train/box_loss',
'train/seg_loss', # train loss
'train/obj_loss',
'train/cls_loss',
'metrics/precision(B)',
'metrics/recall(B)',
'metrics/mAP_0.5(B)',
'metrics/mAP_0.5:0.95(B)', # metrics
'metrics/precision(M)',
'metrics/recall(M)',
'metrics/mAP_0.5(M)',
'metrics/mAP_0.5:0.95(M)', # metrics
'val/box_loss',
'val/seg_loss', # val loss
'val/obj_loss',
'val/cls_loss',
'x/lr0',
'x/lr1',
'x/lr2',]

Sorry, I wanted to keep the changes to a minimum and the result to be similar to how the general train.py, the one that doesn't correspond to segmentation, is programmed.
I will try to avoid duplications and create a new commit.

@glenn-jocher glenn-jocher merged commit ea05d5c into ultralytics:master Mar 9, 2023
@glenn-jocher
Copy link
Member

@iker-lluvia PR looks good, merged!

@iker-lluvia iker-lluvia deleted the patch-2 branch March 10, 2023 06:51
Smfun12 pushed a commit to Smfun12/yolov5 that referenced this pull request Mar 24, 2023
* Correct mutation adding the missing parameters

Correct mutation considering the higher number of segmentation parameters compared to object detection.

Fixes ultralytics#9730

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>

* Use already defined segmentation keys from segment/metrics.py

---------

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
bandakopi pushed a commit to irajcode/yolov5 that referenced this pull request Jul 20, 2023
* Correct mutation adding the missing parameters

Correct mutation considering the higher number of segmentation parameters compared to object detection.

Fixes ultralytics#9730

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>

* Use already defined segmentation keys from segment/metrics.py

---------

Signed-off-by: Iker Lluvia <iker.lluvia@tekniker.es>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

utils/general.py print_mutation variable keys does not correspond to output of seg train/val
2 participants