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

Is this repo runnable? #3

Closed
korcys opened this issue Oct 31, 2021 · 2 comments
Closed

Is this repo runnable? #3

korcys opened this issue Oct 31, 2021 · 2 comments

Comments

@korcys
Copy link

korcys commented Oct 31, 2021

There seems some bugs in this repo. For instance, the parameter of nn.TransformerEncoderLayer d_model in line 30 of transformer.py is the number of expected features in the input which must be divisible by num_heads. But in this repo, the d_model is set as NUM_BOX_FEATURES 109, and num_heads is 4. (109 % 4 eq 1)

@Git-oNmE
Copy link

I also met the same issue. Have you fixed this problem? Look forward to your reply.

@YichaoLu
Copy link
Collaborator

YichaoLu commented Jan 6, 2022

As described in the paper, when num_features is not divisible by num_heads, a fully-connected layer is applied to project num_features into d_model. If you look at the hyperparameter setting for the commit you are referring to, you will find nhead is set to 1 so no fully-connected layer is required. The latest main branch shows the example of adding the fully-connected layer so you can now vary the value of nhead.

@YichaoLu YichaoLu closed this as completed Jan 6, 2022
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

3 participants