Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit 14602a7

Browse files
author
alcinos
authored
Merge pull request #119 from facebookresearch/d2
Bug fix for D2
2 parents b0eca4e + 707d739 commit 14602a7

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

d2/detr/config.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def add_detr_config(cfg):
2323
cfg.MODEL.DETR.ENC_LAYERS = 6
2424
cfg.MODEL.DETR.DEC_LAYERS = 6
2525
cfg.MODEL.DETR.PRE_NORM = False
26-
cfg.MODEL.DETR.PASS_POS_AND_QUERY = True
2726

2827
cfg.MODEL.DETR.HIDDEN_DIM = 256
2928
cfg.MODEL.DETR.NUM_OBJECT_QUERIES = 100

d2/detr/detr.py

-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ def __init__(self, cfg):
8585
enc_layers = cfg.MODEL.DETR.ENC_LAYERS
8686
dec_layers = cfg.MODEL.DETR.DEC_LAYERS
8787
pre_norm = cfg.MODEL.DETR.PRE_NORM
88-
pass_pos_and_query = cfg.MODEL.DETR.PASS_POS_AND_QUERY
8988

9089
# Loss parameters:
9190
giou_weight = cfg.MODEL.DETR.GIOU_WEIGHT
@@ -107,7 +106,6 @@ def __init__(self, cfg):
107106
num_decoder_layers=dec_layers,
108107
normalize_before=pre_norm,
109108
return_intermediate_dec=deep_supervision,
110-
pass_pos_and_query=pass_pos_and_query,
111109
)
112110

113111
self.detr = DETR(

models/detr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def forward(self, samples: NestedTensor):
5656
- "aux_outputs": Optional, only returned when auxilary losses are activated. It is a list of
5757
dictionnaries containing the two above keys for each decoder layer.
5858
"""
59-
if not isinstance(samples, NestedTensor):
59+
if isinstance(samples, list):
6060
samples = nested_tensor_from_tensor_list(samples)
6161
features, pos = self.backbone(samples)
6262

0 commit comments

Comments
 (0)