PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.06k stars 7.81k forks source link

一张卡上部署两个ocr进程,想提升卡的利用率,但结果在处理请求时报错了 #14139

Open fakeache opened 1 week ago

fakeache commented 1 week ago

🔎 Search before asking

🐛 Bug (问题描述)

error: (InvalidArgument) Cannot parse tensor desc
  [Hint: Expected desc.ParseFromArray(buf.get(), size) == true, but received desc.ParseFromArray(buf.get(), size):0 != true:1.] (at ../paddle/fluid/framework/tensor_util.cc:689)
  [operator < load_combine > error]
Traceback (most recent call last):
  File "/root/code/server.py", line 132, in doc_structure_page
    result, table_images = process_page_func(img, index, table_recognition)
  File "/root/code/./custom/doc_struct_pipeline.py", line 109, in process_page_func
    custom_model = model_manager.get_model(True, False)
  File "/root/code/./magic_pdf/model/doc_analyze_by_custom_model.py", line 63, in get_model
    self._models[key] = custom_model_init(ocr=ocr, show_log=show_log)
  File "/root/code/./magic_pdf/model/doc_analyze_by_custom_model.py", line 93, in custom_model_init
    custom_model = CustomPEKModel(**model_input)
  File "/root/code/./magic_pdf/model/pdf_extract_kit.py", line 230, in __init__
    self.ocr_model = atom_model_manager.get_atom_model(
  File "/root/code/./magic_pdf/model/pdf_extract_kit.py", line 112, in get_atom_model
    self._models[atom_model_name] = atom_model_init(model_name=atom_model_name, **kwargs)
  File "/root/code/./magic_pdf/model/pdf_extract_kit.py", line 135, in atom_model_init
    atom_model = ocr_model_init(
  File "/root/code/./magic_pdf/model/pdf_extract_kit.py", line 78, in ocr_model_init
    model = ModifiedPaddleOCR(show_log=show_log, det_db_box_thresh=det_db_box_thresh)
  File "/root/code/./magic_pdf/model/pek_sub_modules/self_modify.py", line 248, in __init__
    super().__init__(lang='en', **kwargs)
  File "/usr/local/lib/python3.10/site-packages/paddleocr/paddleocr.py", line 616, in __init__
    super().__init__(params)
  File "/usr/local/lib/python3.10/site-packages/paddleocr/tools/infer/predict_system.py", line 46, in __init__
    self.text_detector = predict_det.TextDetector(args)
  File "/usr/local/lib/python3.10/site-packages/paddleocr/tools/infer/predict_det.py", line 141, in __init__
    self.predictor, self.input_tensor, self.output_tensors, self.config = utility.create_predictor(
  File "/usr/local/lib/python3.10/site-packages/paddleocr/tools/infer/utility.py", line 280, in create_predictor
    predictor = inference.create_predictor(config)
ValueError: (InvalidArgument) Cannot parse tensor desc
  [Hint: Expected desc.ParseFromArray(buf.get(), size) == true, but received desc.ParseFromArray(buf.get(), size):0 != true:1.] (at ../paddle/fluid/framework/tensor_util.cc:689)
  [operator < load_combine > error]

🏃‍♂️ Environment (运行环境)

os centos
paddlerOCR 3.0.0b1
GPU nvidia A100
python 3.10.12
paddleocr                  2.7.3
paddlepaddle               3.0.0b1
paddlepaddle-gpu           3.0.0b1
nvidia-cublas-cu11         11.11.3.6
nvidia-cublas-cu12         12.1.3.1
nvidia-cuda-cupti-cu11     11.8.87
nvidia-cuda-cupti-cu12     12.1.105
nvidia-cuda-nvrtc-cu11     11.8.89
nvidia-cuda-nvrtc-cu12     12.1.105
nvidia-cuda-runtime-cu11   11.8.89
nvidia-cuda-runtime-cu12   12.1.105
nvidia-cudnn-cu11          8.7.0.84
nvidia-cudnn-cu12          8.9.2.26
nvidia-cufft-cu11          10.9.0.58
nvidia-cufft-cu12          11.0.2.54
nvidia-curand-cu11         10.3.0.86
nvidia-curand-cu12         10.3.2.106
nvidia-cusolver-cu11       11.4.1.48
nvidia-cusolver-cu12       11.4.5.107
nvidia-cusparse-cu11       11.7.5.86
nvidia-cusparse-cu12       12.1.0.106
nvidia-nccl-cu11           2.19.3
nvidia-nccl-cu12           2.20.5
nvidia-nvjitlink-cu12      12.6.68
nvidia-nvtx-cu11           11.8.86
nvidia-nvtx-cu12           12.1.105

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

cuicheng01 commented 1 day ago

您好,可以尝试使用PaddleX解决下您的问题呢