#18295·PaddleOCR

PP-OCRv6 models are not registered in PaddleX when using PP-StructureV3 pipeline

Author: DreamJokerMJCreated Jul 30, 2026Updated Sep 5, 2026

Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

Bug (问题描述)

在使用 PP-StructureV3 产线配置本地 PP-OCRv6 模型时,服务启动失败,报错 ClassNotFoundException: PP-OCRv6_medium_det is not registered on BasePredictor,尽管官方文档声称支持 PP-OCRv6。

完整错误日志

Checking connectivity to the model hosters, this may take a while. To bypass this check, set `DISABLE_MODEL_SOURCE_CHECK` to `True`.
Creating model: ('PP-LCNet_x1_0_doc_ori', None)
Model files already exist. Using cached files. To redownload, please delete the directory manually: `/root/.paddlex/official_models/PP-LCNet_x1_0_doc_ori`.
Creating model: ('UVDoc', None)
Model files already exist. Using cached files. To redownload, please delete the directory manually: `/root/.paddlex/official_models/UVDoc`.
Creating model: ('PP-DocBlockLayout', None)
Model files already exist. Using cached files. To redownload, please delete the directory manually: `/root/.paddlex/official_models/PP-DocBlockLayout`.
Creating model: ('PP-DocLayout_plus-L', None)
Model files already exist. Using cached files. To redownload, please delete the directory manually: `/root/.paddlex/official_models/PP-DocLayout_plus-L`.
Creating model: ('PP-LCNet_x1_0_textline_ori', None)
Model files already exist. Using cached files. To redownload, please delete the directory manually: `/root/.paddlex/official_models/PP-LCNet_x1_0_textline_ori`.
Creating model: ('PP-OCRv6_medium_det', '/paddle/config/PP-OCRv6_medium_det_infer')
Failed to create the pipeline
Traceback (most recent call last):
  File "/root/PaddleX/paddlex/paddlex_cli.py", line 500, in serve
    pipeline = create_pipeline(
  File "/root/PaddleX/paddlex/inference/pipelines/__init__.py", line 167, in create_pipeline
    pipeline = BasePipeline.get(pipeline_name)(
  File "/root/PaddleX/paddlex/utils/deps.py", line 206, in _wrapper
    return old_init_func(self, *args, **kwargs)
  File "/root/PaddleX/paddlex/inference/pipelines/_parallel.py", line 103, in __init__
    self._pipeline = self._create_internal_pipeline(config, self.device)
  File "/root/PaddleX/paddlex/inference/pipelines/_parallel.py", line 158, in _create_internal_pipeline
    return self._pipeline_cls(
  File "/root/PaddleX/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py", line 84, in __init__
    self.inintial_predictor(config)
  File "/root/PaddleX/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py", line 173, in inintial_predictor
    self.general_ocr_pipeline = self.create_pipeline(
  File "/root/PaddleX/paddlex/inference/pipelines/base.py", line 140, in create_pipeline
    pipeline = create_pipeline(
  File "/root/PaddleX/paddlex/inference/pipelines/__init__.py", line 167, in create_pipeline
    pipeline = BasePipeline.get(pipeline_name)(
  File "/root/PaddleX/paddlex/utils/deps.py", line 206, in _wrapper
    return old_init_func(self, *args, **kwargs)
  File "/root/PaddleX/paddlex/inference/pipelines/_parallel.py", line 103, in __init__
    self._pipeline = self._create_internal_pipeline(config, self.device)
  File "/root/PaddleX/paddlex/inference/pipelines/_parallel.py", line 158, in _create_internal_pipeline
    return self._pipeline_cls(
  File "/root/PaddleX/paddlex/inference/pipelines/ocr/pipeline.py", line 117, in __init__
    self.text_det_model = self.create_model(
  File "/root/PaddleX/paddlex/inference/pipelines/base.py", line 106, in create_model
    model = create_predictor(
  File "/root/PaddleX/paddlex/inference/models/__init__.py", line 84, in create_predictor
    return BasePredictor.get(model_name)(
  File "/root/PaddleX/paddlex/utils/subclass_register.py", line 94, in get
    raise_class_not_found_error(name, cls, all_entities)
  File "/root/PaddleX/paddlex/utils/errors/others.py", line 112, in raise_class_not_found_error
    raise ClassNotFoundException(msg)
paddlex.utils.errors.others.ClassNotFoundException: `PP-OCRv6_medium_det` is not registered on BasePredictor.

从注册列表中可以看到,仅包含 PP-OCRv5_*PP-OCRv4_* 相关模型,没有 PP-OCRv6_* 条目。

‍♂️ Environment (运行环境)

项目 详细信息
操作系统 Linux (宿主机 Ubuntu 22.04)
Docker 镜像 paddlex-ocr-serving:v01
CUDA 版本 12.9.0
GPU NVIDIA GeForce RTX 4090
内存 32 GB
PaddleX 版本 来自镜像,具体未知(应为最新稳定版)
Python 版本 3.10+ (容器内)
配置文件 PP-StructureV3 产线 YAML
模型路径 挂载到容器内 /paddle/config/

额外的软件包(容器内已预装):

  • PaddlePaddle GPU 版本
  • PaddleX 及相关依赖

Minimal Reproducible Example (最小可复现问题的Demo)

步骤

  1. 下载 PP-OCRv6 推理模型(官方链接):
    wget https://paddleocr.bj.bcebos.com/models/PP-OCRv6/PP-OCRv6_medium_det_infer.tar
    wget https://paddleocr.bj.bcebos.com/models/PP-OCRv6/PP-OCRv6_medium_rec_infer.tar
    
  2. 解压到 ./paddlex_config/ 目录,使其与 PP_StructureV3.yaml 同级:
    tar -xf PP-OCRv6_medium_det_infer.tar -C ./paddlex_config/
    tar -xf PP-OCRv6_medium_rec_infer.tar -C ./paddlex_config/
    
  3. 修改 PP_StructureV3.yaml,在 GeneralOCRTableRecognition.SubPipelines.GeneralOCR 下,将 TextDetectionTextRecognitionmodel_namemodel_dir 设置为:
    TextDetection:
      module_name: text_detection
      model_name: PP-OCRv6_medium_det
      model_dir: /paddle/config/PP-OCRv6_medium_det_infer
    TextRecognition:
      module_name: text_recognition
      model_name: PP-OCRv6_medium_rec
      model_dir: /paddle/config/PP-OCRv6_medium_rec_infer
    
  4. 启动 Docker 容器:
    docker run --gpus all --name paddlex_structure \
      -v ./paddlex_config:/paddle/config \
      -v ./.paddlex:/root/.paddlex \
      --shm-size=16g -p 8080:8080 -d \
      paddlex-ocr-serving:v01 \
      paddlex --serve --pipeline /paddle/config/PP_StructureV3.yaml --device gpu:0 --port 8080
    
  5. 查看日志:
    docker logs paddlex_structure
    

预期行为:服务正常启动,使用本地 PP-OCRv6 模型进行 OCR。
实际行为:服务启动失败,报错模型未注册。