OpenGVLab / InternImage

[CVPR 2023 Highlight] InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Convolutions
https://arxiv.org/abs/2211.05778
MIT License
2.47k stars 231 forks source link

About the stride in detection/ops_dcnv3 #258

Closed GoblinCraftman closed 9 months ago

GoblinCraftman commented 9 months ago

I found that in detection/ops_ In the Pytorch version of dcnv3, the calculation of offset does not consider the stride, and the side is specified as 1 in the test code.

When we attempted to calculate using a stride of 2, there was a conflict between the size of the unstriped matrix obtained by offset and the size of the scaled matrix obtained by the stride 2. The error matrix size would be exactly twice that of this time.

The final code error will be:

Sampling_ Locations=(ref+grid * offsetscale). repeat (N, 1, 1, 1, 1). flat (3,4)+\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: The size of tensor a (x) must match the size of tensor b (2x) at non-singleton dimension 2

I want to know: Is it the code that does not recommend using non 1 stride or is there an error handling at offset?

baic9120 commented 5 months ago

hello, have you solved this problem?look forward to your answer, thanks!!

YanjunPen commented 3 months ago

hello, I also have this problem, have you do anything to solve it?