{"record":{"id":"7815697bb9fe22a0","repo":"open-mmlab/mmdetection","slug":"cache-files-can-not-be-saved-automatically-to-spe","errorCode":null,"errorMessage":"Cache files can not be saved automatically! To speed uploading the dataset, please manually generate the cache file by file tools/misc/get_crowdhuman_id_hw.py","messagePattern":"Cache files can not be saved automatically! To speed uploading the dataset, please manually generate the cache file by file tools/misc/get_crowdhuman_id_hw\\.py","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mmdet/datasets/crowdhuman.py","lineNumber":84,"sourceCode":"        Returns:\n            List[dict]: A list of annotation.\n        \"\"\"  # noqa: E501\n        anno_strs = get_text(\n            self.ann_file, backend_args=self.backend_args).strip().split('\\n')\n        print_log('loading CrowdHuman annotation...', level=logging.INFO)\n        data_list = []\n        prog_bar = ProgressBar(len(anno_strs))\n        for i, anno_str in enumerate(anno_strs):\n            anno_dict = json.loads(anno_str)\n            parsed_data_info = self.parse_data_info(anno_dict)\n            data_list.append(parsed_data_info)\n            prog_bar.update()\n        if not self.extra_ann_exist and get_rank() == 0:\n            #  TODO: support file client\n            try:\n                dump(self.extra_anns, self.extra_ann_file, file_format='json')\n            except:  # noqa\n                warnings.warn(\n                    'Cache files can not be saved automatically! To speed up'\n                    'loading the dataset, please manually generate the cache'\n                    ' file by file tools/misc/get_crowdhuman_id_hw.py')\n\n            print_log(\n                f'\\nsave extra_ann_file in {self.data_root}',\n                level=logging.INFO)\n\n        del self.extra_anns\n        print_log('\\nDone', level=logging.INFO)\n        return data_list\n\n    def parse_data_info(self, raw_data_info: dict) -> Union[dict, List[dict]]:\n        \"\"\"Parse raw annotation to target format.\n\n        Args:\n            raw_data_info (dict): Raw data information load from ``ann_file``\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/open-mmlab/mmdetection/blob/cfd5d3a985b0249de009b67d04f37263e11cdf3d/mmdet/datasets/crowdhuman.py#L66-L102","documentation":"Warning from CrowdHuman dataset load_data_list: the intermediate extra annotation cache (id->h/w for full-set computation) could not be dumped to self.extra_ann_file, usually because the path is read-only/unsupported, so it will be recomputed every run.","triggerScenarios":"Loading CrowdHumanDataset where self.extra_ann_exist is False and dump(self.extra_anns, ...) fails (bare except) — e.g. data_root not writable, or non-local file system where the TODO notes file client isn't supported.","commonSituations":"Read-only dataset mounts (NFS/shared clusters), containers where /data is ro; dataset still works but loading is slower each time.","solutions":["Make data_root writable so the cache json can be saved","Pre-generate the cache with tools/misc/get_crowdhuman_id_hw.py and place it at the expected extra_ann_file path","If read-only is mandatory, accept the recompute cost"],"exampleFix":"# before: read-only /data\nchmod: not possible\n# after\npython tools/misc/get_crowdhuman_id_hw.py /data/crowdhuman --out /data/crowdhuman/annotation_train.odGT.cache # then ensure it is used as extra_ann_file","handlingStrategy":"fallback","validationCode":"import os\nif not os.access(data_root, os.W_OK):\n    print('CrowdHuman cache cannot be written; pre-generate with tools/misc/get_crowdhuman_id_hw.py')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure writable data_root for annotation caches","Pre-generate cache files for read-only mounts"],"tags":["python","warning","crowdhuman","cache","filesystem","dataset"],"backgroundTag":"cache-write-failed","analyzedSha":"cfd5d3a985b0249de009b67d04f37263e11cdf3d","analyzedAt":"2026-08-27T20:54:20.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}