facebookresearch / VMZ

VMZ: Model Zoo for Video Modeling
Apache License 2.0
1.04k stars 156 forks source link

Arbitrary frame depth average pooling kernel size #81

Closed fksato closed 4 years ago

fksato commented 4 years ago

Average pooling in r2plus1d, and possibly others, raise errors when dealing with frame depths not a multiple of 8. Suggested fix would be to change final_temporal_kernel = int( clip_length / 8 / conv1_temporal_stride) in r3d_model.py line 158 to: final_temporal_kernel = int( ceil(clip_length / 8) / conv1_temporal_stride)

dutran commented 4 years ago

@fksato Thanks for the comment, we actually implement this as an virtual assert to make sure the model is correct and what we want it to be. Otherwise, one can replace AvergagePool by ReduceMean it will give the same as global average pooling with arbitrary kernel size.