{"record":{"id":"4ea38e1e30423c0c","repo":"PaddlePaddle/PaddleOCR","slug":"not-found-infer-list","errorCode":null,"errorMessage":"not found infer list {}","messagePattern":"not found infer list (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"ppocr/utils/utility.py","lineNumber":70,"sourceCode":"    if mode == \"train_eval\":\n        check_params = check_params + [\n            \"train_batch_size_per_card\",\n            \"test_batch_size_per_card\",\n        ]\n    elif mode == \"test\":\n        check_params = check_params + [\"test_batch_size_per_card\"]\n    return check_params\n\n\ndef _check_image_file(path):\n    img_end = {\"jpg\", \"bmp\", \"png\", \"jpeg\", \"rgb\", \"tif\", \"tiff\", \"gif\", \"pdf\"}\n    return any([path.lower().endswith(e) for e in img_end])\n\n\ndef get_image_file_list(img_file, infer_list=None):\n    imgs_lists = []\n    if infer_list and not os.path.exists(infer_list):\n        raise Exception(\"not found infer list {}\".format(infer_list))\n    if infer_list:\n        with open(infer_list, \"r\") as f:\n            lines = f.readlines()\n        for line in lines:\n            image_path = line.strip().split(\"\\t\")[0]\n            image_path = os.path.join(img_file, image_path)\n            imgs_lists.append(image_path)\n    else:\n        if img_file is None or not os.path.exists(img_file):\n            raise Exception(\"not found any img file in {}\".format(img_file))\n\n        img_end = {\"jpg\", \"bmp\", \"png\", \"jpeg\", \"rgb\", \"tif\", \"tiff\", \"gif\", \"pdf\"}\n        if os.path.isfile(img_file) and _check_image_file(img_file):\n            imgs_lists.append(img_file)\n        elif os.path.isdir(img_file):\n            for single_file in os.listdir(img_file):\n                file_path = os.path.join(img_file, single_file)\n                if os.path.isfile(file_path) and _check_image_file(file_path):","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/utils/utility.py#L52-L88","documentation":"Exception from get_image_file_list (ppocr/utils/utility.py) when an infer_list file path is supplied but does not exist on disk. The list file is expected to be a text file with one image path (optionally tab-separated from a label) per line, resolved relative to img_file.","triggerScenarios":"Calling prediction/evaluation entry points with image_dir plus an infer_list (e.g. rec_gt_test.txt style list) whose path is typo'd, absolute-mismatched, or not downloaded yet.","commonSituations":"Benchmarking on ICDAR/ReCTS/LaTeX lists that must be fetched separately; running tools from a different working directory with a relative infer_list path; config eval lists pointing at an unmounted dataset volume.","solutions":["Verify the list file exists at the exact path passed (ls it) and fix the path or download/generate the list.","Use an absolute path for infer_list to avoid working-directory sensitivity.","Confirm each line's first tab-separated field names an image that exists under img_file."],"exampleFix":"# before\nget_image_file_list('imgs', infer_list='eval_list.txt')  # file missing in cwd\n\n# after\nget_image_file_list('imgs', infer_list='/data/eval/eval_list.txt')","handlingStrategy":"validation","validationCode":"import os\n\ndef valid_infer_list(p) -> bool:\n    return p is None or (os.path.isfile(p) and os.path.getsize(p) > 0)\n\nassert valid_infer_list(infer_list), f\"infer list missing or empty: {infer_list}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for dataset list files in configs and scripts.","Mount/verify dataset volumes before starting evaluation jobs."],"tags":["inference","dataset","validation","file-io"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}