Skip to content

Commit

Permalink
bug fix for D2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Carion committed Jun 29, 2020
1 parent b0eca4e commit 707d739
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion d2/detr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def add_detr_config(cfg):
cfg.MODEL.DETR.ENC_LAYERS = 6
cfg.MODEL.DETR.DEC_LAYERS = 6
cfg.MODEL.DETR.PRE_NORM = False
cfg.MODEL.DETR.PASS_POS_AND_QUERY = True

cfg.MODEL.DETR.HIDDEN_DIM = 256
cfg.MODEL.DETR.NUM_OBJECT_QUERIES = 100
Expand Down
2 changes: 0 additions & 2 deletions d2/detr/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def __init__(self, cfg):
enc_layers = cfg.MODEL.DETR.ENC_LAYERS
dec_layers = cfg.MODEL.DETR.DEC_LAYERS
pre_norm = cfg.MODEL.DETR.PRE_NORM
pass_pos_and_query = cfg.MODEL.DETR.PASS_POS_AND_QUERY

# Loss parameters:
giou_weight = cfg.MODEL.DETR.GIOU_WEIGHT
Expand All @@ -107,7 +106,6 @@ def __init__(self, cfg):
num_decoder_layers=dec_layers,
normalize_before=pre_norm,
return_intermediate_dec=deep_supervision,
pass_pos_and_query=pass_pos_and_query,
)

self.detr = DETR(
Expand Down
2 changes: 1 addition & 1 deletion models/detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def forward(self, samples: NestedTensor):
- "aux_outputs": Optional, only returned when auxilary losses are activated. It is a list of
dictionnaries containing the two above keys for each decoder layer.
"""
if not isinstance(samples, NestedTensor):
if isinstance(samples, list):
samples = nested_tensor_from_tensor_list(samples)
features, pos = self.backbone(samples)

Expand Down

0 comments on commit 707d739

Please sign in to comment.