PaddlePaddle / models

Officially maintained, supported by PaddlePaddle, including CV, NLP, Speech, Rec, TS, big models and so on.
Apache License 2.0
6.9k stars 2.91k forks source link

PaddleDetection infer时候出错 #3531

Open dbcool opened 5 years ago

dbcool commented 5 years ago

您好,我在进行paddle检测的infer时候, 在运行 outs = exe.run(infer_prog, feed=feeder.feed(data), fetch_list=values, return_numpy=False) 这一行的时候出错: Traceback (most recent call last): File "tools/infer_video.py", line 442, in main() File "tools/infer_video.py", line 316, in main return_numpy=False) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 650, in run use_program_cache=use_program_cache) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 748, in _run exe.run(program.desc, scope, 0, True, True, fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: Invoke operator multiclass_nms error. Python Callstacks: File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 1748, in append_op attrs=kwargs.get("attrs", None)) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, *kwargs) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/layers/detection.py", line 2771, in multiclass_nms outputs={'Out': output}) File "/home/daibing/baidu_daibing/cncert-source/logo_detection/ppdet/core/workspace.py", line 95, in partial_apply return op(args, **kwargs_) File "/home/daibing/baidu_daibing/cncert-source/logo_detection/ppdet/modeling/roi_heads/bbox_head.py", line 300, in get_prediction pred_result = self.nms(bboxes=cliped_box, scores=cls_prob) File "/home/daibing/baidu_daibing/cncert-source/logo_detection/ppdet/modeling/architectures/faster_rcnn.py", line 120, in build im_shape) File "/home/daibing/baidu_daibing/cncert-source/logo_detection/ppdet/modeling/architectures/faster_rcnn.py", line 130, in test return self.build(feed_vars, 'test') File "tools/infer_video.py", line 257, in main test_fetches = model.test(feed_vars) File "tools/infer_video.py", line 442, in main() C++ Callstacks: Enforce failed. Expected begin_idx < end_idx, but received begin_idx:103 >= end_idx:103. The start row index must be lesser than the end row index. at [/paddle/paddle/fluid/framework/tensor.cc:78] PaddlePaddle Call Stacks:

MyPandaShaoxiang commented 5 years ago

你好,能具体描述下问题么,使用的模型从哪里来的,用的哪个版本的检测代码,cpu上进行的?

qingqing01 commented 5 years ago

@dbcool 看log是通过faster rcnn预测,重新写了一个infer_video.py文件,在multiclass_nms里出错。 不知道有没有改动其他信息?

排查方法,可以先看下单张图片使用原始的infer流程能否测通,来确保模型加载、使用流程正确。另外,可以在 /home/daibing/baidu_daibing/cncert-source/logo_detection/ppdet/modeling/roi_heads/bbox_head.py 文件倒数第二行前,加Print打印输入的看下输入的shape,在排查下。

fluid.layers.Print(cliped_box, summarize=20)
pred_result = self.nms(bboxes=cliped_box, scores=cls_prob)
return {'bbox': pred_result}
dbcool commented 5 years ago

您好,模型是自己的训练的,用的是paddle1.5,GPU上进行的,训练和预测代码没动过,这个错在测试十几万图像时出现,我现在按照楼上的说法试试看

qingqing01 commented 4 years ago

@dbcool 请问问题是否已解决?