导出模型export_model - CascadeCA RCNN OIDV5的模型错误
收藏
当expert_model 模型 CascadeCA RCNN时,执行下面命令:
export_model.py -c configs/oidv5/cascade_rcnn_cls_aware_r200_vd_fpn_dcnv2_nonlocal_softnms.yml --output_dir=./inference_model -o weights='./oidv5_cascade_rcnn_cls_aware_r200_vd_fpn_dcnv2_nonlocal_softnms/'
报告下面错误:
Exception: The program contains py_func with input: ['box_clip_0.tmp_0', 'tmp_9'], output: ['softnms_pred_result']. It is not supported in Paddle inference engine. please replace it by paddle ops. For example, if you use MultiClassSoftNMS, better to replace it by MultiClassNMS.
0
收藏
请登录后评论
算子不支持,自己重写一下算子吧。
谢谢回复:
在:PaddleDetection/static/ppdet/modeling/ops.py文件里已定义注册自己的算子:
class MultiClassSoftNMS(object):
fluid.layers.py_func(func=_batch_softnms, x=[bboxes, scores], out=pred_result)
但在执行static/tools/export_model.py 导出模型为什么还报上面错误(调用check_py_func)?
请大神指教!
MultiClassSoftNMS 采用Python实现,不支持模型导出。如果要部署的化,可以考虑换成MultiClassNMS,看下对精度的影响,然后导出模型。