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

[Bug]: Downstream forward_raw() methods have incorrect permutation #148

Open
collinmccarthy opened this issue Jan 14, 2025 · 0 comments
Open

Comments

@collinmccarthy
Copy link

This issue relates to the implementation in downstream/object_detection/dino/models/dino /fastervit.py. I'm using this FasterViT implementation as a backbone for my own object detector, so I only needed the forward_raw() method. However this method leads to an error because the output format is incorrect, due to an unnecessary permutation.

This line I'm guessing was supposed to permute NHWC-> NCHW, but the output from the layers is already in NCHW format so this actually permutes it from NCHW -> NWCH.

# Bug: x_out already NCHW, so this permutes to NWCH
outs.append(x_out.permute(0, 3, 1, 2).contiguous()) 

Similarly here in the motrv2 models.

These lines should simply be deleted and it will work. I don't see this function actually being used anywhere, hence why it wasn't caught.

@collinmccarthy collinmccarthy changed the title Bug in downstream forward_raw() methods (incorrect permutation) [Bug]: Downstream forward_raw() methods have incorrect permutation Jan 22, 2025
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