Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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 train the interaction head individually #49

Closed
xiaoxiaoczw opened this issue Jul 12, 2022 · 4 comments
Closed

How to train the interaction head individually #49

xiaoxiaoczw opened this issue Jul 12, 2022 · 4 comments

Comments

@xiaoxiaoczw
Copy link

Hi Fred,

I would like to know that, how to freeze detector weights to train the interaction head individually? Thanks!

@fredzzhang
Copy link
Owner

Hi @xiaoxiaoczw,

The detector weights are in fact frozen already. We fine-tuned the object detector as a first stage and only train the interaction head next. The corresponding code is here.

    for p in upt.detector.parameters():
        p.requires_grad = False
    param_dicts = [{
        "params": [p for n, p in upt.named_parameters()
        if "interaction_head" in n and p.requires_grad]
    }]

Fred.

@xiaoxiaoczw
Copy link
Author

Hi Fred,

Thanks for your quick feedback!
By the way, which pretrained weights do I need to load if I want to train on my own dataset?

@fredzzhang
Copy link
Owner

To get the best performance, you would want to fine-tune the object detector on the custom dataset first, and then train the interaction head. But if the custom dataset has the same set of objects and you don't want to go through the trouble, you can just load the provided detector weights. You can choose amongst the pre-trained MS COCO weights, fine-tuned HICO-DET weights and the fine-tuned V-COCO weights. Which one works the best for you really depends on the dataset similarity. It would be hard to guess without running experiments.

Fred.

@xiaoxiaoczw
Copy link
Author

Thanks for the suggestion!

Repository owner locked and limited conversation to collaborators Jul 16, 2022
@fredzzhang fredzzhang converted this issue into discussion #50 Jul 16, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants