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
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 0 additions & 126 deletions paddle/fluid/operators/detection/generate_proposals_v2_op.cc

This file was deleted.

8 changes: 0 additions & 8 deletions paddle/phi/api/yaml/legacy_ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -590,14 +590,6 @@
data_type : dtype
backend : place

- 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 :
func : GenerateProposalsV2InferMeta
kernel :
func : generate_proposals

- op : greater_equal
args : (Tensor x, Tensor y)
output : Tensor(out)
Expand Down
6 changes: 6 additions & 0 deletions paddle/phi/api/yaml/op_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
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.

好的👌


- op : grad_add
extra :
attrs : [bool use_mkldnn = false, str x_data_format = "", str y_data_format = "", str mkldnn_data_type = "float32",
Expand Down
8 changes: 8 additions & 0 deletions paddle/phi/api/yaml/op_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@
comment : "The arg 'default_value' of attr 'shape' is changed: from 'None' to '{}'."
default : std::vector<int64_t>{}

- op : generate_proposals
version :
- checkpoint : Registe generate_proposals_v2 for adding the attribute of pixel_offset
action :
- add_attr : pixel_offset
comment : If true, im_shape pixel offset is 1.
default : "true"

- op : greater_equal
version :
- checkpoint : Upgrade compare ops, add a new attribute [force_cpu]
Expand Down
10 changes: 10 additions & 0 deletions paddle/phi/api/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,16 @@
func : gelu
backward : gelu_grad

- 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
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

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配置设置一下,这里的参数格式不对

data_type : anchors

- op : grid_sample
args : (Tensor x, Tensor grid, str mode = "bilinear", str padding_mode = "zeros", bool align_corners = true)
output : Tensor(out)
Expand Down
19 changes: 0 additions & 19 deletions paddle/phi/ops/compat/generate_proposals_sig.cc

This file was deleted.