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

num_classes during model creation #3

Open
SupremeLobster opened this issue Jan 25, 2022 · 0 comments
Open

num_classes during model creation #3

SupremeLobster opened this issue Jan 25, 2022 · 0 comments

Comments

@SupremeLobster
Copy link

If my understanding is correct, when you do:

self.class_embed = nn.Linear(hidden_dim, num_classes)

at DeformableDETR() in deformable_detr.py, "num_classes" should instead be "num_classes + 1"

The same thing goes for:

self.class_embed.bias.data = torch.ones(num_classes) * bias_value

in the same DeformableDETR() function, where it should be "num_classes + 1" instead of "num_classes".

Otherwise I'm just getting confused somewhere, but I'm pretty sure there should be an extra background class logit.

That is how it was done in the original DETR code anyways.

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

No branches or pull requests

1 participant