Make default axis of softmax in onnx "-1" without opset option#24613
Merged
asmorkalov merged 12 commits intoopencv:4.xfrom Dec 15, 2023
Merged
Make default axis of softmax in onnx "-1" without opset option#24613asmorkalov merged 12 commits intoopencv:4.xfrom
asmorkalov merged 12 commits intoopencv:4.xfrom
Conversation
fengyuentau
reviewed
Nov 29, 2023
Member
Author
|
Not sure why always abi test failed. |
Contributor
|
@WanliZhong Could you push to the branch to trigger build once more. CI was broken the time you created the patch. My fault. |
Contributor
|
@WanliZhong Could you add some test for the case or unlock some "conformance" test that covers it? |
Member
Author
|
@asmorkalov Thanks for comments. I will try it. |
Contributor
|
Member
Author
|
yes, the failed CI have shown we can't modify the default axis to -1 in softmax layer. I propose just make this happen on onnx model. |
dkurt
approved these changes
Dec 15, 2023
| { | ||
| const std::string& layer_type = node_proto.op_type(); | ||
| int axis; | ||
| if (layerParams.has("opset") && layerParams.get<int>("opset") > 11) { |
Contributor
There was a problem hiding this comment.
Should we update parseQSoftmax too? (may be in a separate PR?)
Member
Author
There was a problem hiding this comment.
Let me try to change it in QSoftmax
Contributor
There was a problem hiding this comment.
Please create dedicated PR for parseQSoftmax.
fengyuentau
reviewed
Dec 15, 2023
Merged
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
May 29, 2024
Make default axis of softmax in onnx "-1" without opset option opencv#24613 Try to solve problem: opencv#24476 (comment) **ONNX** `opset <= 11` use 1 `else` use -1 **TensorFlow** `TF version = 2.x` use -1 `else` use 1 **Darknet, Caffe, Torch** use 1 by definition
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.
Try to solve problem: #24476 (comment)
ONNX
opset <= 11use 1elseuse -1TensorFlow
TF version = 2.xuse -1elseuse 1Darknet, Caffe, Torch
use 1 by definition