{"record":{"id":"5c745b99a57ac200","repo":"PaddlePaddle/PaddleOCR","slug":"the-datatype-is-not-supported","errorCode":null,"errorMessage":"the datatype is not supported","messagePattern":"the datatype is not supported","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"ppocr/utils/formula_utils/unimernet_data_convert.py","lineNumber":107,"sourceCode":"        \"--output_path\", type=str, default=\"out_label.txt\", help=\"Output file name\"\n    )\n    parser.add_argument(\n        \"--datatype\", type=str, default=\"out_label.txt\", help=\"datatype\"\n    )\n    args = parser.parse_args()\n    if args.datatype == \"unimernet_train\":\n        latexocr2paddleocr_train(\n            args.image_dir,\n            args.unimernet_txt_path,\n            args.hme100k_txt_path,\n            args.output_path,\n        )\n    elif args.datatype == \"unimernet_test\":\n        unimernet2paddleocr_test(\n            args.image_dir, args.unimernet_txt_path, args.output_path\n        )\n    else:\n        raise NotImplementedError(\"the datatype is not supported\")\n","sourceCodeStart":89,"sourceCodeEnd":108,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/utils/formula_utils/unimernet_data_convert.py#L89-L108","documentation":"NotImplementedError from the CLI of ppocr/utils/formula_utils/unimernet_data_convert.py: the --datatype argument only accepts exactly 'unimernet_train' or 'unimernet_test'; any other string falls through both branches and raises.","triggerScenarios":"Running the UniMERNet data conversion script with a typo'd or unsupported --datatype, e.g. 'unimernet_val', 'train', or 'Unimernet_Test'.","commonSituations":"Preparing LaTeX/formula recognition training data; users assume 'val'/'test' split vocabulary from other conversion scripts; case or underscore mistakes when copying the command from docs.","solutions":["Use exactly --datatype unimernet_train or --datatype unimernet_test.","Check the script's argument help/source for the supported values before running.","For a validation split, convert it with unimernet_test if that matches your evaluation pipeline."],"exampleFix":"# before\npython unimernet_data_convert.py --datatype unimernet_val ...\n\n# after\npython unimernet_data_convert.py --datatype unimernet_test ...","handlingStrategy":"validation","validationCode":"ALLOWED = {\"unimernet_train\", \"unimernet_test\"}\nif args.datatype not in ALLOWED:\n    raise SystemExit(f\"--datatype must be one of {sorted(ALLOWED)}, got {args.datatype!r}\")","typeGuard":"def is_supported_datatype(v) -> bool:\n    return v in {\"unimernet_train\", \"unimernet_test\"}","tryCatchPattern":null,"preventionTips":["Check the script's accepted --datatype values before running conversion jobs.","Wrap data-prep pipelines in a shell script that validates arguments up front."],"tags":["data-conversion","cli","formula-recognition"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}