{"record":{"id":"3205b3dc4b7e4e7f","repo":"open-mmlab/mmdetection","slug":"ignore-label-and-loss-weight-would-be-depr","errorCode":null,"errorMessage":"``ignore_label`` and ``loss_weight`` would be deprecated soon. Please set ``ingore_index`` and ``loss_weight`` in ``loss_seg`` instead.","messagePattern":"``ignore_label`` and ``loss_weight`` would be deprecated soon\\. Please set ``ingore_index`` and ``loss_weight`` in ``loss_seg`` instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/models/roi_heads/mask_heads/fused_semantic_head.py","lineNumber":97,"sourceCode":"                    in_channels,\n                    conv_out_channels,\n                    3,\n                    padding=1,\n                    conv_cfg=self.conv_cfg,\n                    norm_cfg=self.norm_cfg))\n        self.conv_embedding = ConvModule(\n            conv_out_channels,\n            conv_out_channels,\n            1,\n            conv_cfg=self.conv_cfg,\n            norm_cfg=self.norm_cfg)\n        self.conv_logits = nn.Conv2d(conv_out_channels, self.num_classes, 1)\n        if ignore_label:\n            loss_seg['ignore_index'] = ignore_label\n        if loss_weight:\n            loss_seg['loss_weight'] = loss_weight\n        if ignore_label or loss_weight:\n            warnings.warn('``ignore_label`` and ``loss_weight`` would be '\n                          'deprecated soon. Please set ``ingore_index`` and '\n                          '``loss_weight`` in ``loss_seg`` instead.')\n        self.criterion = MODELS.build(loss_seg)\n\n    def forward(self, feats: Tuple[Tensor]) -> Tuple[Tensor]:\n        \"\"\"Forward function.\n\n        Args:\n            feats (tuple[Tensor]): Multi scale feature maps.\n\n        Returns:\n            tuple[Tensor]:\n\n                - mask_preds (Tensor): Predicted mask logits.\n                - x (Tensor): Fused feature.\n        \"\"\"\n        x = self.lateral_convs[self.fusion_level](feats[self.fusion_level])\n        fused_size = tuple(x.shape[-2:])","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/models/roi_heads/mask_heads/fused_semantic_head.py#L79-L115","documentation":"Warning from FusedSemanticHead.__init__: the standalone `ignore_label` and `loss_weight` constructor arguments are being deprecated; they are merely copied into loss_seg['ignore_index'] / loss_seg['loss_weight']. Set them inside the loss_seg dict instead.","triggerScenarios":"Constructing FusedSemanticHead with ignore_label=-1 (typical for Panoptic FPN / HTC configs) and/or an explicit loss_weight argument; any config inherited from older mask-rcnn/htc configs.","commonSituations":"Upgrading configs from older mmdet where ignore_label/loss_weight were top-level head args; panoptic segmentation setups.","solutions":["Move ignore_label into loss_seg as ignore_index (e.g. loss_seg=dict(type='CrossEntropyLoss', ignore_index=-1))","Move loss_weight into loss_seg as loss_weight","Remove the top-level ignore_label/loss_weight keys from the head config"],"exampleFix":"# before\nroi_head=dict(..., semantic_head=dict(type='FusedSemanticHead', ignore_label=-1, loss_weight=0.2))\n# after\nroi_head=dict(..., semantic_head=dict(type='FusedSemanticHead', loss_seg=dict(type='CrossEntropyLoss', ignore_index=-1, loss_weight=0.2)))","handlingStrategy":"validation","validationCode":"assert 'ignore_label' not in sem_head_cfg and 'loss_weight' not in sem_head_cfg, 'set ignore_index/loss_weight inside loss_seg'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Move all loss kwargs into the loss dict when migrating heads","Compare with current panoptic-fpn/htc configs after upgrades"],"tags":["mmdet","deprecation","semantic-head","panoptic"],"backgroundTag":"deprecated-argument-migrated","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}