-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Feature] Support TimeSformer #839
Conversation
congee524
commented
Apr 28, 2021
•
edited
Loading
edited
- Attention Code
- TimeSformer Backbone Code
- TimeSformer Head
- Inference
- Train
- CheckPoint
- Refine Code
- Add Docstring
- Unittest
- README
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current min version of mmcv is 1.3.1, is it sufficient for this PR?
configs/recognition/timesformer/timesformer_divST_8x32x1_15e_kinetics400_rgb.py
Outdated
Show resolved
Hide resolved
Oh, seems not. You need to update the version requirement as well as the CI. Besides, you can add some unittest to improve the CodeCov |
OK. The work may need to wait until mmcv 1.3.5 release. |
You can ping me after this PR is ready. |
ae1c5d1
to
5abcab8
Compare
self.num_heads = num_heads | ||
self.num_frames = num_frames | ||
self.norm = build_norm_layer(norm_cfg, self.embed_dims)[1] | ||
self.attn = nn.MultiheadAttention(embed_dims, num_heads, attn_drop, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you need to use MultiheadAttention from mmcv since it takes the arg batch_first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should be turned into mmcv MultiheadAttention, pytorch 1.9 includes arg but previous versions not.
self.num_heads = num_heads | ||
self.num_frames = num_frames | ||
self.norm = build_norm_layer(norm_cfg, self.embed_dims)[1] | ||
self.attn = nn.MultiheadAttention(embed_dims, num_heads, attn_drop, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
It seems MMCV minimum version 1.3.6 is required. |
@shvdiwnkozbw The old checkpoints also need to be updated. You can send me the converted checkpoint. |
Codecov Report
@@ Coverage Diff @@
## master #839 +/- ##
==========================================
- Coverage 83.73% 83.34% -0.39%
==========================================
Files 132 135 +3
Lines 9982 10311 +329
Branches 1718 1764 +46
==========================================
+ Hits 8358 8594 +236
- Misses 1210 1285 +75
- Partials 414 432 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This is the link for converted checkpoint |
Have you tested the converted checkpoints? It seems that the testing accuracy doesn't align with the reported numbers, e.g., I got 61.8% Top-1 when I test the divST model (jointST failed). |
I have not tested the accuracy since my account has been cancelled, are there any missing parameters when loading the converted checkpoint? |
For divST, the parameter names aligned perfectly but the accuracy is about 10% inferior. For jointST, the checkpoint can not be loaded properly. |