{"record":{"id":"80bf53406533176e","repo":"open-mmlab/mmdetection","slug":"panoptic-segmentation-map-will-not-be-compressed","errorCode":null,"errorMessage":"Panoptic segmentation map will not be compressed. The dumped file will be extremely large! Suggest using `CocoPanopticMetric` to save the coco format json and segmentation png files directly.","messagePattern":"Panoptic segmentation map will not be compressed\\. The dumped file will be extremely large! Suggest using `CocoPanopticMetric` to save the coco format json and segmentation png files directly\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/evaluation/metrics/dump_det_results.py","lineNumber":42,"sourceCode":"            'gpu'. Defaults to 'cpu'.\n    \"\"\"\n\n    def process(self, data_batch: dict, data_samples: Sequence[dict]) -> None:\n        \"\"\"transfer tensors in predictions to CPU.\"\"\"\n        data_samples = _to_cpu(data_samples)\n        for data_sample in data_samples:\n            # remove gt\n            data_sample.pop('gt_instances', None)\n            data_sample.pop('ignored_instances', None)\n            data_sample.pop('gt_panoptic_seg', None)\n\n            if 'pred_instances' in data_sample:\n                pred = data_sample['pred_instances']\n                # encode mask to RLE\n                if 'masks' in pred:\n                    pred['masks'] = encode_mask_results(pred['masks'].numpy())\n            if 'pred_panoptic_seg' in data_sample:\n                warnings.warn(\n                    'Panoptic segmentation map will not be compressed. '\n                    'The dumped file will be extremely large! '\n                    'Suggest using `CocoPanopticMetric` to save the coco '\n                    'format json and segmentation png files directly.')\n        self.results.extend(data_samples)\n","sourceCodeStart":24,"sourceCodeEnd":48,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/evaluation/metrics/dump_det_results.py#L24-L48","documentation":"DumpDetResults.process() warns when a data sample contains pred_panoptic_seg: panoptic segmentation maps are stored as uncompressed label maps, so the dumped pickle will be extremely large. The warning suggests using CocoPanopticMetric which writes COCO-format JSON plus compressed PNG segmentations instead.","triggerScenarios":"Running evaluation with DumpDetResults(outfile_path=...) on a panoptic segmentation model; any sample with a 'pred_panoptic_seg' key triggers the warning during process().","commonSituations":"Users swap val_evaluator to DumpDetResults for offline analysis of a panoptic model (e.g. Panoptic FPN) and get multi-GB pickle files.","solutions":["Use CocoPanopticMetric with outfile_prefix to dump COCO-format JSON and PNG files instead","If you truly need raw dumps, accept the large file and ensure ample disk space","Post-process: convert panoptic maps to compressed PNG after dumping instead of storing raw arrays"],"exampleFix":"# before\nval_evaluator = dict(type='DumpDetResults', outfile_path='results.pkl')\n# after\nval_evaluator = dict(type='CocoPanopticMetric', outfile_prefix='results')","handlingStrategy":"fallback","validationCode":"has_panoptic = any('pred_panoptic_seg' in s for s in data_samples)\nif has_panoptic:\n    # prefer CocoPanopticMetric over DumpDetResults\n    ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use CocoPanopticMetric for panoptic models needing dumped outputs","Estimate dump size beforehand; avoid DumpDetResults on panoptic pipelines","Set outfile_prefix and clean old dumps to manage disk"],"tags":["mmdet","panoptic-segmentation","dump-results","disk-usage","coco"],"backgroundTag":"large-result-dump","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}