From 707d7399fb80e95163b5c9c21b4bf1bb19a26f9a Mon Sep 17 00:00:00 2001 From: Nicolas Carion Date: Mon, 29 Jun 2020 16:35:13 +0200 Subject: [PATCH] bug fix for D2 --- d2/detr/config.py | 1 - d2/detr/detr.py | 2 -- models/detr.py | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/d2/detr/config.py b/d2/detr/config.py index 45cc81e35..27aca83ea 100644 --- a/d2/detr/config.py +++ b/d2/detr/config.py @@ -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 diff --git a/d2/detr/detr.py b/d2/detr/detr.py index 7d1d6c2a7..42e4e2340 100644 --- a/d2/detr/detr.py +++ b/d2/detr/detr.py @@ -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 @@ -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( diff --git a/models/detr.py b/models/detr.py index d58dcd609..857ab2a2b 100644 --- a/models/detr.py +++ b/models/detr.py @@ -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)