{"record":{"id":"8963658006caeefe","repo":"PaddlePaddle/PaddleOCR","slug":"does-not-exist-896365","errorCode":null,"errorMessage":"{} does not exist!","messagePattern":"(.+?) does not exist!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ppocr/data/pubtab_dataset.py","lineNumber":106,"sourceCode":"\n    def shuffle_data_random(self):\n        if self.do_shuffle:\n            random.seed(self.seed)\n            random.shuffle(self.data_lines)\n        return\n\n    def __getitem__(self, idx):\n        try:\n            data_line = self.data_lines[idx]\n            data_line = data_line.decode(\"utf-8\").strip(\"\\n\")\n            info = json.loads(data_line)\n            file_name = info[\"filename\"]\n            cells = info[\"html\"][\"cells\"].copy()\n            structure = info[\"html\"][\"structure\"][\"tokens\"].copy()\n\n            img_path = os.path.join(self.data_dir, file_name)\n            if not os.path.exists(img_path):\n                raise Exception(\"{} does not exist!\".format(img_path))\n            data = {\n                \"img_path\": img_path,\n                \"cells\": cells,\n                \"structure\": structure,\n                \"file_name\": file_name,\n            }\n\n            with open(data[\"img_path\"], \"rb\") as f:\n                img = f.read()\n                data[\"image\"] = img\n            outs = transform(data, self.ops)\n        except:\n            import traceback\n\n            err = traceback.format_exc()\n            self.logger.error(\n                \"When parsing line {}, error happened with msg: {}\".format(\n                    data_line, err","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/data/pubtab_dataset.py#L88-L124","documentation":"The PubTabNet table-recognition dataset reads JSONL annotations (filename, html.cells, html.structure.tokens), joins data_dir with info['filename'], and raises Exception('{path} does not exist!') when the table image is absent. The bare except then logs and skips the sample.","triggerScenarios":"Training/evaluating PP-Structure table models with a PubTabNet JSONL whose 'filename' entries do not resolve under data_dir: images not downloaded, data_dir wrong, or filename containing a subdirectory that was flattened on unzip.","commonSituations":"Downloading PubTabNet JSONL but not the image archive; using val.jsonl with train images only; data_dir pointing at the JSONL folder instead of the image folder.","solutions":["Verify one entry: python -c 'import json,os; i=json.loads(open(\"train.jsonl\").readline()); print(os.path.exists(os.path.join(data_dir, i[\"filename\"])))'","Set data_dir in the table yml to the directory containing the images referenced by filename","Download/restore the missing image splits from the PubTabNet distribution","If the layout differs, rewrite the JSONL filenames with a small script instead of moving gigabytes of images"],"exampleFix":"# before (config)\ndata_dir: ./train_data/pubtabnet\n# after (images live one level down)\ndata_dir: ./train_data/pubtabnet/train_images","handlingStrategy":"validation","validationCode":"import json, os\nfor line in open(jsonl_path, encoding='utf-8'):\n    fn = json.loads(line)['filename']\n    if not os.path.exists(os.path.join(data_dir, fn)):\n        raise SystemExit(f'{fn} missing under {data_dir}')","typeGuard":null,"tryCatchPattern":"try:\n    out = dataset[idx]\nexcept Exception:\n    out = None  # logged and skipped upstream; monitor skip rate","preventionTips":["Download both the PubTabNet images and JSONL and keep the documented layout","Set data_dir to the image root, not the annotation root","Run a JSONL lint pass after any restructuring"],"tags":["dataset","file-not-found","table-recognition","config"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}