lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
1.64k stars 178 forks source link

what are the components in the pred_logits of the decoder? #298

Closed pdt0609 closed 1 month ago

pdt0609 commented 1 month ago

Dear authors, When i change the size of the output of the dec_score_head self.dec_score_head = nn.ModuleList([ nn.Linear(hidden_dim, num_classes) for _ in range(num_decoder_layers) ]) to: self.dec_score_head = nn.ModuleList([ nn.Linear(hidden_dim, hidden_dim) for _ in range(num_decoder_layers)

I have test the size of the pred_logits, while some logits have the correct size 256(as hidden dimensions) why there remain some logits have size 80 ([8, 300, 80]) While the code in rtdetr_decoder.py said that dec_out_logits.append(score_head[i](output)) How tensor size [8, 300, 80] get in the pred_logits?

This is the size of the pred_logits i have printed:(after 6 normal logits size 256, i have a tensor size [8, 300, 80]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 80])
torch.Size([8, 192, 256]) torch.Size([8, 192, 256]) torch.Size([8, 192, 256]) torch.Size([8, 192, 256]) torch.Size([8, 192, 256]) torch.Size([8, 192, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 80]) torch.Size([8, 156, 256]) torch.Size([8, 156, 256]) torch.Size([8, 156, 256]) torch.Size([8, 156, 256]) torch.Size([8, 156, 256]) torch.Size([8, 156, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 256]) torch.Size([8, 300, 80])

lyuwenyu commented 1 month ago

I don't know where you printed pred_logits, maybe it's because it also includes enc_topk_logits.