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

How to freeze backbone when finetune on custom dataset #126

Open
4 tasks done
lzyuan168 opened this issue Sep 8, 2023 · 1 comment
Open
4 tasks done

How to freeze backbone when finetune on custom dataset #126

lzyuan168 opened this issue Sep 8, 2023 · 1 comment
Labels
question Further information is requested

Comments

@lzyuan168
Copy link

Before Asking

  • I have read the README carefully. 我已经仔细阅读了README上的操作指引。

  • I want to train my custom dataset, and I have read the tutorials for finetune on your data carefully and organize my dataset correctly; 我想训练自定义数据集,我已经仔细阅读了训练自定义数据的教程,以及按照正确的目录结构存放数据集。

  • I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。

Search before asking

  • I have searched the DAMO-YOLO issues and found no similar questions.

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

@lzyuan168 lzyuan168 added the question Further information is requested label Sep 8, 2023
@ksv87
Copy link

ksv87 commented Mar 29, 2024

class Detector(nn.Module):
def __init__(self, config):
super().__init__()
self.backbone = build_backbone(config.model.backbone)
self.neck = build_neck(config.model.neck)
self.head = build_head(config.model.head)
self.config = config
def init_bn(self, M):

you can freeze backbone here

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

No branches or pull requests

2 participants