Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layout fastdeploy_serving方式部署 Failed to process the request(s) for model 'postprocess_0', message: TypeError: run(): incompatible function arguments. #2409

Open
lsx66 opened this issue Mar 20, 2024 · 3 comments
Assignees

Comments

@lsx66
Copy link

lsx66 commented Mar 20, 2024

版面分析算法, fastdeploy_serving方式部署,在StructureV2LayoutPostprocessor后处理时报错
Failed to process the request(s) for model 'postprocess_0', message: TypeError: run(): incompatible function arguments. The following argument types are supported:
1. (self: fastdeploy.libs.fastdeploy_main.vision.ocr.StructureV2LayoutPostprocessor, arg0: List[fastdeploy.libs.fastdeploy_main.FDTensor], arg1: List[List[int[4]]]) -> List[fastdeploy.libs.fastdeploy_main.vision.DetectionResult]
Invoked with: <fastdeploy.libs.fastdeploy_main.vision.ocr.StructureV2LayoutPostprocessor object at 0x7f788b5eb4f0>, array([[[ 3.0430562 , 2.9620893 , -0.92005384, ..., -1.1082802 ,
-1.694324 , -1.3905903 ],
[-0.8745545 , 3.1247966 , 3.0257077 , ..., -1.0160857 ,
-1.3037924 , -0.8528714 ],
[-1.1111182 , -1.1563158 , 3.6807263 , ..., -0.8917918 ,
-1.5667745 , -1.2615712 ],
...,
[ 2.574394 , 2.0140955 , -0.02018397, ..., -1.5280299 ,
-1.9861596 , -1.8610322 ],
[ 0.99233127, 1.3739115 , 0.8655137 , ..., -1.4873394 ,
-1.9895219 , -1.8228513 ],
[ 0.2792613 , 0.42100033, 1.0559945 , ..., -1.313761 ,
-1.8969777 , -1.7097901 ]]], dtype=float32), [array([640, 404, 608, 800], dtype=object)]

At:
/usr/local/lib/python3.8/dist-packages/fastdeploy/vision/ocr/ppocr/init.py(778): run
/ocr_serving/vision/ocr/PP-OCR/serving/fastdeploy_serving/models-layout/postprocess/1/model.py(109): execute

版面分析后处理model.py报错行
results = self.postprocessor_.run([infer_outputs], [im_infos])
参数打印出
infer_outputs shape is (1, 130, 32)
im_infos: [640 404 608 800]

ppocr/init.py 中StructureV2LayoutPostprocessor类
class StructureV2LayoutPostprocessor:
def init(self):
"""Create a postprocessor for StructureV2Layout Model
"""
self._postprocessor = C.vision.ocr.StructureV2LayoutPostprocessor()

def run(self, runtime_results, ims_info):
    """Postprocess the runtime results for StructureV2Layout Model
    :param: runtime_results: (list of FDTensor or list of pyArray)The output FDTensor results from runtime
    :return: list of Result(If the runtime_results is predict by batched samples, the length of this list equals to the batch size)
    """
    return self._postprocessor.run(runtime_results, ims_info)
@Jiang-Jia-Jun
Copy link
Collaborator

具体报错日志截图发下

@lsx66
Copy link
Author

lsx66 commented Mar 21, 2024

屏幕截图 2024-03-21 182540

@Jiang-Jia-Jun
Copy link
Collaborator

看这个提示应该是 这个函数第一个参数要求是FDTensor,但实际上传入了一个np.ndarray

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants