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

I reimplement your model (Teacher: R101, Student: R50, Detection head: Foveabox) and got RuntimeError: shape '[-1, 68]' is invalid for input of size 115200 #61

Open
letruongngochai opened this issue Mar 8, 2023 · 5 comments

Comments

@letruongngochai
Copy link

letruongngochai commented Mar 8, 2023

Hello, here I try to replace the detection head used with Foveabox. I use R50 as a student and R101 as a teacher to distill. But I can't manage to train it due to the above error. Is there any advices in changing the detection head of your model that you can give me? Thanks

@letruongngochai letruongngochai changed the title I reimplement your model (Teacher: Foveabox R101, Student: Foveabox R50) and got RuntimeError: shape '[-1, 68]' is invalid for input of size 115200 I reimplement your model (Teacher: R101, Student: R50, Detection head: Foveabox) and got RuntimeError: shape '[-1, 68]' is invalid for input of size 115200 Mar 8, 2023
@HikariTJU
Copy link
Owner

Have you modified the head to use general distribution? Like what I did in atss_gfl_head.py

@letruongngochai
Copy link
Author

Can you tell me where to view the .py file you mentioned?

@HikariTJU
Copy link
Owner

https://github.com/HikariTJU/LD/blob/main/mmdet/models/dense_heads/atss_gfl_head.py

  1. you need to change network from 4-d ltrb to 4x17 distribution (refer to GFocal)
    self.atss_reg = nn.Conv2d(
  2. when calculate bbox loss use integral to transform 4x17 distribution back to 4-d ltrb
    pos_bbox_pred_corners = self.integral(pos_bbox_pred)

@letruongngochai
Copy link
Author

Sorry but I just don't get the "4-d ltrb" point, what is it actually?

@HikariTJU
Copy link
Owner

ltrb is introduced in FCOS to replace xywh, I know a little about FoveaBox, maybe you should change xywh to ltrb at first
image

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

2 participants