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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamlined Finetuning: hyp by task and train straight from model without requiring model yaml. #678

Closed
glenn-jocher opened this issue Aug 9, 2020 · 1 comment 路 Fixed by #680
Assignees
Labels
enhancement New feature or request

Comments

@glenn-jocher
Copy link
Member

glenn-jocher commented Aug 9, 2020

馃殌 Feature

It's time to streamline finetuning in YOLOv5. It's become evident that finetuning and training from scratch likely require different set of hyps to each perform their best. I see two action items for this:

  1. Remove hardcoded hyps from train.py into a seperate coco.hyp.yaml. This sets the stage for defining a second coco.finetune.hyp.yaml with new hyps defined via hyp evolution on a finetune scenario (probably VOC 50 epochs).

  2. Update the train configuration to allow single-file start, vs today's dual-file requirements (i.e. a pair of yolov5s.yaml and yolov5s.pt). This change is now available as the v2.0 format embeds a model's original yaml as a class property:

    yolov5/models/yolo.py

    Lines 64 to 67 in d7cfbc4

    self.yaml_file = Path(cfg).name
    with open(cfg) as f:
    self.yaml = yaml.load(f, Loader=yaml.FullLoader) # model dict

This should allow us to better define default training settings depending on whether finetune mode is used or not. finetune model would automatically be set to true if a *.pt model argument was supplied to train.py instead of a *.yaml argument. Drawback is that all the tutorials will need updating :(

@glenn-jocher glenn-jocher added the enhancement New feature or request label Aug 9, 2020
@glenn-jocher glenn-jocher self-assigned this Aug 9, 2020
@glenn-jocher glenn-jocher linked a pull request Aug 9, 2020 that will close this issue
@glenn-jocher
Copy link
Member Author

Removing TODO, this is completed.

@glenn-jocher glenn-jocher removed the TODO label Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant