tinyvision / DAMO-YOLO

DAMO-YOLO: a fast and accurate object detection method with some new techs, including NAS backbones, efficient RepGFPN, ZeroHead, AlignedOTA, and distillation enhancement.
Apache License 2.0
3.79k stars 476 forks source link

How to freeze backbone when finetune on custom dataset #126

Open lzyuan168 opened 1 year ago

lzyuan168 commented 1 year ago

Before Asking

Search before asking

Question

Hi, I would like to know if there is an option to freeze backbone when finetuning on custom dataset. Because according to the the tutorial, there is only a line to add "self.train.finetune_path" which points to the pretrained .pth weights. However, if I run the train.py file without freezing the backbone, isn't that equal to training from scratch?

Thank you.

Additional

No response

ksv87 commented 8 months ago

https://github.com/tinyvision/DAMO-YOLO/blob/319572eef367340267ab6ab8ae253527a71d7c3a/damo/detectors/detector.py#L12-L25

you can freeze backbone here