PaddlePaddle/PaddleOCR · error · ValueError

{model_name} is not supported. Please check if the model is

Error message

{model_name} is not supported. Please check if the model is supported by the PaddleOCR wheel.

What it means

TextE2E (tools/infer/predict_e2e.py) reads inference.yml from the e2e model directory, and — unlike cls/det/rec — rejects ANY model that declares a Global.model_name at all. The end-to-end pipeline is not supported by the PaddleOCR wheel, so any model carrying modern metadata fails immediately. Models without inference.yml proceed unchecked, but no wheel-blessed e2e model ships that metadata.

Source

Thrown at tools/infer/predict_e2e.py:43

import time
import sys

import tools.infer.utility as utility
from ppocr.utils.logging import get_logger
from ppocr.utils.utility import get_image_file_list, check_and_read
from ppocr.data import create_operators, transform
from ppocr.postprocess import build_post_process

logger = get_logger()


class TextE2E(object):
    def __init__(self, args):
        if os.path.exists(f"{args.e2e_model_dir}/inference.yml"):
            model_config = utility.load_config(f"{args.e2e_model_dir}/inference.yml")
            model_name = model_config.get("Global", {}).get("model_name", "")
            if model_name:
                raise ValueError(
                    f"{model_name} is not supported. Please check if the model is supported by the PaddleOCR wheel."
                )

        self.args = args
        self.e2e_algorithm = args.e2e_algorithm
        self.use_onnx = args.use_onnx
        pre_process_list = [
            {"E2EResizeForTest": {}},
            {
                "NormalizeImage": {
                    "std": [0.229, 0.224, 0.225],
                    "mean": [0.485, 0.456, 0.406],
                    "scale": "1./255.",
                    "order": "hwc",
                }
            },
            {"ToCHWImage": None},
            {"KeepKeys": {"keep_keys": ["image", "shape"]}},

View on GitHub (pinned to 2661c7c0ef)

Solutions

  1. Use the legacy e2e model packages from the PaddleOCR model zoo, which do not include inference.yml
  2. Delete inference.yml from the e2e model directory (the gate only fires when the file exists)
  3. Switch from e2e to the standard det+rec pipeline, which is fully supported by the wheel

Example fix

# before
--e2e_model_dir=./inference/e2e_server_pgnetA  # contains inference.yml -> ValueError

# after
rm ./inference/e2e_server_pgnetA/inference.yml
# or use the original zoo tarball without inference.yml
Defensive patterns

Strategy: validation

Validate before calling

import os
yml = os.path.join(e2e_model_dir, 'inference.yml')
if os.path.exists(yml):
    raise SystemExit('e2e models carrying inference.yml are rejected by the wheel — use legacy zoo packages or remove the yml')

Try / catch

try:
    e2e = TextE2E(args)
except ValueError as e:
    if 'not supported' in str(e):
        raise SystemExit('e2e pipeline unsupported by wheel; use det+rec instead')
    raise

Prevention

When it happens

Trigger: Running e2e inference (--e2e_algorithm=True / predict_e2e) with --e2e_model_dir pointing at a model directory that contains an inference.yml with a non-empty Global.model_name.

Common situations: Reusing a PGNet/premium e2e model repackaged with new-style metadata; pointing --e2e_model_dir at a det/rec model dir by mistake; mixing new wheel conventions with the legacy e2e zoo models.

Related errors


AI-assisted analysis of PaddlePaddle/PaddleOCR@2661c7c0ef (2026-08-14). Data as JSON: /api/errors/f2470edf5ca14ad7. Report an issue: GitHub.