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

python推理 ttfnet\ttfnet_darknet53_1x_coco 的示例代码报错 #8974

Open
3 tasks done
535205856 opened this issue May 11, 2024 · 0 comments
Open
3 tasks done

python推理 ttfnet\ttfnet_darknet53_1x_coco 的示例代码报错 #8974

535205856 opened this issue May 11, 2024 · 0 comments
Assignees

Comments

@535205856
Copy link

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

Inference, Deploy

Bug描述 Describe the Bug

推理使用的导出 ttfnet\ttfnet_darknet53_1x_coco的模型为推理模型
ttfnet\ttfnet_darknet53_1x_coco
推理配置文件为 infer_cfg.yml, 内容如下, labellist根据实际整理出来了,未贴出

mode: paddle
draw_threshold: 0.5
metric: COCO
use_dynamic_shape: false
arch: TTFNet
min_subgraph_size: 60
Preprocess:

  • interp: 1
    keep_ratio: false
    target_size:
    • 320
    • 320
      type: Resize
  • is_scale: false
    mean:
    • 123.675
    • 116.28
    • 103.53
      std:
    • 58.395
    • 57.12
    • 57.375
      type: NormalizeImage
  • type: Permute
    label_list: []

"""
‘File "E:\work_aiplat\pp_detection_sample\PaddleDetection\deploy\python\infer.py"
result = self.predict()
File "E:\work_aiplat\pp_detection_sample\PaddleDetection\deploy\python\infer.py", line xxx, in predict
self.predictor.run()
RuntimeError: In user code:

File "cus_share/PaddleDetection/eyecool_export_test_for_folder.py", line 155, in <module>
  export_pretrain_model_by_config_folder(path=WEIGHTS_HOME)
File "cus_share/PaddleDetection/eyecool_export_test_for_folder.py", line 40, in export_pretrain_model_by_config_folder
  export_pretrain_model_by_config_folder(item_path, suffix, outFilter)
File "cus_share/PaddleDetection/eyecool_export_test_for_folder.py", line 52, in export_pretrain_model_by_config_folder
  export_model_by_config_and_weight(item_path)
File "cus_share/PaddleDetection/eyecool_export_test_for_folder.py", line 148, in export_model_by_config_and_weight
  trainer.export(infer_folder)
File "/xxx/cus_share/PaddleDetection/ppdet/engine/trainer.py", line 734, in export
  save_dir)
File "/xxx/cus_share/PaddleDetection/ppdet/engine/trainer.py", line 711, in _get_infer_cfg_and_input_spec
  input_spec, static_model.forward.main_program,
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 563, in main_program
  concrete_program = self.concrete_program
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 479, in concrete_program
  return self.concrete_program_specify_input_spec(input_spec=None)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 517, in concrete_program_specify_input_spec
  *desired_input_spec)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 427, in get_concrete_program
  concrete_program, partial_program_layer = self._program_cache[cache_key]
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 723, in __getitem__
  self._caches[item] = self._build_once(item)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 714, in _build_once
  **cache_key.kwargs)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/decorator.py", line 232, in fun
  return caller(func, *(extras + args), **kw)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in __impl__
  return wrapped_func(*args, **kwargs)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/base.py", line 51, in __impl__
  return func(*args, **kwargs)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/program_translator.py", line 662, in from_func_spec
  outputs = static_func(*inputs)
File "/tmp/tmpw0mit3rj.py", line 100, in forward
  false_fn_5, (), (inputs, self), (out,))
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 211, in convert_ifelse
  out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 257, in _run_py_ifelse
  return true_fn(*true_args) if pred else false_fn(*false_args)
File "/tmp/tmpw0mit3rj.py", line 83, in false_fn_5
  for_loop_body_0, [__for_loop_var_index_0, inputs_list])
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 45, in convert_while_loop
  loop_vars = _run_py_while(cond, body, loop_vars)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 59, in _run_py_while
  loop_vars = body(*loop_vars)
File "/tmp/tmpw0mit3rj.py", line 78, in for_loop_body_0
  dy2static.convert_call(self.get_pred)())
File "/xxx/cus_share/PaddleDetection/ppdet/modeling/architectures/ssd.py", line 87, in get_pred
  bbox_pred, bbox_num = self._forward()
File "/tmp/tmptnn0rlyn.py", line 30, in _forward
  __return_value_0, hm, self, wh), (__return_value_0,))
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 211, in convert_ifelse
  out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 257, in _run_py_ifelse
  return true_fn(*true_args) if pred else false_fn(*false_args)
File "/xxx/cus_share/PaddleDetection/ppdet/modeling/architectures/ttfnet.py", line 76, in _forward
  self.inputs['scale_factor'])
File "/tmp/tmp_daipi44.py", line 41, in __call__
  bbox_num, bbox_pred))
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 211, in convert_ifelse
  out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 257, in _run_py_ifelse
  return true_fn(*true_args) if pred else false_fn(*false_args)
File "/xxx/cus_share/PaddleDetection/ppdet/modeling/post_process.py", line 67, in __call__
  bbox_pred, bbox_num, _ = self.nms(bboxes, score, self.num_classes)
File "/tmp/tmps6ydz4yp.py", line 99, in __call__
  __return_value_4, bboxes, kwargs, score, self), (__return_value_4,))
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 211, in convert_ifelse
  out = _run_py_ifelse(pred, true_fn, false_fn, true_args, false_args)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/dygraph/dygraph_to_static/convert_operators.py", line 257, in _run_py_ifelse
  return true_fn(*true_args) if pred else false_fn(*false_args)
File "/xxx/cus_share/PaddleDetection/ppdet/modeling/layers.py", line 486, in __call__
  return bbox, bbox_num, None
File "/xxx/cus_share/PaddleDetection/ppdet/modeling/ops.py", line 1058, in multiclass_nms
  outputs=outputs)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op
  return self.main_program.current_block().append_op(*args, **kwargs)
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/framework.py", line 3184, in append_op
  attrs=kwargs.get("attrs", None))
File "/xxx/condas/envs/xxx/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2224, in __init__
  for frame in traceback.extract_stack():

NotFoundError: Operator (multiclass_nms3) does not have kernel for data_type[int]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN].
  [Hint: Expected kernel_iter != kernels.end(), but received kernel_iter == kernels.end().] (at C:\home\workspace\Paddle_release\paddle\fluid\framework\operator.cc:1297)
  [operator < multiclass_nms3 > error]
  """

复现环境 Environment

  • OS: Linux/Windows
  • PaddlePaddle: 2.2.2
  • PaddleDetection: release/2.5
  • Python: 3.7.0
  • CUDA: 10.1
  • CUDNN: 7.6
  • GCC: 8.2.0

windows使用的cpu推理的,linux使用cpu/gpu 均出现该错误

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
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

2 participants