PaddlePaddle/PaddleOCR · error · NotImplementedError
the datatype is not supported
Error message
the datatype is not supported
What it means
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.
Source
Thrown at ppocr/utils/formula_utils/unimernet_data_convert.py:107
"--output_path", type=str, default="out_label.txt", help="Output file name"
)
parser.add_argument(
"--datatype", type=str, default="out_label.txt", help="datatype"
)
args = parser.parse_args()
if args.datatype == "unimernet_train":
latexocr2paddleocr_train(
args.image_dir,
args.unimernet_txt_path,
args.hme100k_txt_path,
args.output_path,
)
elif args.datatype == "unimernet_test":
unimernet2paddleocr_test(
args.image_dir, args.unimernet_txt_path, args.output_path
)
else:
raise NotImplementedError("the datatype is not supported")
View on GitHub (pinned to 2661c7c0ef)
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.
Example fix
# before python unimernet_data_convert.py --datatype unimernet_val ... # after python unimernet_data_convert.py --datatype unimernet_test ...
Defensive patterns
Strategy: validation
Validate before calling
ALLOWED = {"unimernet_train", "unimernet_test"}
if args.datatype not in ALLOWED:
raise SystemExit(f"--datatype must be one of {sorted(ALLOWED)}, got {args.datatype!r}") Type guard
def is_supported_datatype(v) -> bool:
return v in {"unimernet_train", "unimernet_test"} Prevention
- Check the script's accepted --datatype values before running conversion jobs.
- Wrap data-prep pipelines in a shell script that validates arguments up front.
When it happens
Trigger: Running the UniMERNet data conversion script with a typo'd or unsupported --datatype, e.g. 'unimernet_val', 'train', or 'Unimernet_Test'.
Common situations: 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.
Related errors
- Could not parse xcresulttool JSON: {e}.
- xcresulttool export attachments failed with exit {r.returnco
- Could not resolve exported file (wanted {wanted_out_name!r},
- xcresulttool metrics export failed
- error: {msg}
AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14).
Data as JSON: /api/errors/5c745b99a57ac200.
Report an issue: GitHub.