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

support the 'generate_proposals' for generating static graph ops #52940

Merged
merged 8 commits into from
Apr 24, 2023

Conversation

longranger2
Copy link
Contributor

@longranger2 longranger2 commented Apr 14, 2023

PR types

Others

PR changes

Others

Description

add autogen code support for generate_proposals
#51842

@paddle-bot
Copy link

paddle-bot bot commented Apr 14, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Apr 14, 2023
infer_meta :
func : GenerateProposalsV2InferMeta
kernel :
func : generate_proposals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加data_type : anchors

- op : generate_proposals
args : (Tensor scores, Tensor bbox_deltas, Tensor im_shape, Tensor anchors, Tensor variances, int pre_nms_top_n, int post_nms_top_n, float nms_thresh, float min_size, float eta, bool pixel_offset=true)
output : Tensor(rpn_rois), Tensor(rpn_roi_probs), Tensor(rpn_rois_num)
infer_meta :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加optional : rpn_rois_num

func : GenerateProposalsV2InferMeta
kernel :
func : generate_proposals
optional : rpn_rois_num
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考其他ops的optional data_type配置设置一下,这里的参数格式不对

Copy link
Contributor

@heavyrain-lzy heavyrain-lzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全局搜索generate_proposals_v2_op.cc,应该会在paddle/fluid/operators/detection/CMakeLists.txt找到依赖这个文件的代码,请删除相关代码。

inputs :
{scores : Scores, bbox_deltas : BboxDeltas, im_shape : ImShape, anchors : Anchors, variances : Variances}
outputs :
{rpn_rois : RpnRois, rpn_roi_probs : RpnRoiProbs, rpn_rois_num : RpnRoisNum}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以通过ci-py3的错误信息同时结合xxx_op.cc文件,这里有部分attrs的name名字也需要映射。仔细对比xxx_op.cc文件和yaml中的名字进行修改,如"pre_nms_top_n",请全面对比名字。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的👌

@@ -952,6 +952,12 @@
extra :
attrs : [bool use_mkldnn = false, str mkldnn_data_type = "float32"]

- op : generate_proposals(generate_proposals_v2)
inputs :
{scores : Scores, bbox_deltas : BboxDeltas, im_shape : ImShape, anchors : Anchors, variances : Variances, pre_nms_top_n : pre_nms_topN, post_nms_top_n : post_nms_topN}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs里只会有tensor类型的参数,其余类型的要配置到attrs中,可以参考其他算子的配置。

Copy link
Contributor Author

@longranger2 longranger2 Apr 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来是这样,之前就好奇 inputsattrs有什么区别,看到有的用inputs,有的用 attrs,还以为这两个都可以

Copy link
Contributor

@heavyrain-lzy heavyrain-lzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@luotao1 luotao1 merged commit 5e1ee10 into PaddlePaddle:develop Apr 24, 2023
lijialin03 pushed a commit to lijialin03/Paddle that referenced this pull request Apr 25, 2023
…dlePaddle#52940)

* support the 'generate_proposals' for generating static graph ops

* fix bug

* fix bug

* Update ops.yaml

fix bug

* remove the generate_proposals_v2_op.cc from CMakeLists.txt

* fix bug

* fix bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants