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.75k stars 470 forks source link

How to freeze backbone when finetune on custom dataset #126

Open lzyuan168 opened 12 months ago

lzyuan168 commented 12 months 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 5 months ago

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

you can freeze backbone here