Open
Description
Checklist:
- 查找历史相关issue寻求解答
- 翻阅FAQ
- 翻阅PaddleX 文档
- 确认bug是否在新版本里还未修复
描述问题
以serve形式启动涉及版面识别的piepline,layout_threshold不支持以字典形式给不同目标类型不同的阈值
复现
启动服务
paddlex --serve --pipeline seal_recognition
调用服务
ret = requests.post(url=PADDLE_SEAL_URL, json={'file': data,
'fileType': 0,
'layoutMergeBboxesMode': 'union',
'layoutThreshold': {0: 0.99, 1: 0.99, 2: 0.06},
# 'sealDetLimitSideLen':100,
})
报错
'[{"type": "float_type", "loc": ["body", "layoutThreshold"], "msg": "Input should be a valid number", "input": {"0": 0.99, "1": 0.99, "2": 0.06}}]'
分析
应为python将json字符串反序列化成python dict时,自动将key转换成str,而pipeline的python接口要求key为int形式。
- 您是否已经正常运行我们提供的教程?
是 - 您是否在教程的基础上修改代码内容?还请您提供运行的代码
无 - 您使用的数据集是?
无 - 请提供您出现的报错信息及相关log
'[{"type": "float_type", "loc": ["body", "layoutThreshold"], "msg": "Input should be a valid number", "input": {"0": 0.99, "1": 0.99, "2": 0.06}}]'
环境
-
请提供您使用的PaddlePaddle和PaddleX的版本号
paddlex==3.0.0 paddlepaddle==3.0.0 -
请提供您使用的操作系统信息,如Linux/Windows/MacOS
Linux with docker -
请问您使用的Python版本是?
python==3.10 -
请问您使用的CUDA/cuDNN的版本号是?
cuda==12.6.8 cudnn==9.5.1.17
Metadata
Metadata
Assignees
Labels
No labels