DNN: support the split node of onnx opset >= 13#23482
Merged
asmorkalov merged 1 commit intoopencv:4.xfrom Apr 14, 2023
Merged
Conversation
This was referenced Apr 11, 2023
bf33fe5 to
51281f8
Compare
dkurt
approved these changes
Apr 11, 2023
| } | ||
| layerParams.set("slice_point", DictValue::arrayInt(&slicePoints[0], slicePoints.size())); | ||
| } | ||
| else if (node_proto.input_size() == 2) // opset >= 13, the split will be stored at the second input, instead of the attribute. |
Contributor
There was a problem hiding this comment.
BTW, there onnx_opset field to avoid guessing using the number of inputs (that is not reliable).
Member
Author
There was a problem hiding this comment.
Thx for your code review. I agree with you, but currently, I have no better solution for this.
Since we can not get the info of opset version.
And from onnx's doc, the split has only input when the opset < 13.
https://github.com/onnx/onnx/blob/main/docs/Changelog.md#split-11
And when opset >= 13, input may have the second input, and it's used only for split.
https://github.com/onnx/onnx/blob/main/docs/Operators.md#split.
vpisarev
approved these changes
Apr 14, 2023
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge with test case: opencv/opencv_extra#1053.
The attribute of
splitinSplit layerhas been moved fromattributetoinput.Related link: https://github.com/onnx/onnx/blob/main/docs/Operators.md#inputs-1---2-12
The purpose of this PR is to support the
splitwith input type.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.