-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
dnn onnx: something wrong after cummutative ops are support in onnx graph simplifier #24568
Copy link
Copy link
Closed
Labels
Milestone
Description
System Information
Tried with code before and after #24483 and also latest.
Detailed description
I am working on the subgraph fusion for BiasGelu. Model is attached here bias_gelu.onnx.zip. Its graph pattern looks like the following,
[Input] -> Add(bias) -> Gelu_pattern -> [Output]
The ONNX simplifier in dnn can already handle the Gelu pattern.
I added the following test case in test_graph_simplifier.cpp to check layer types after fusion,
TEST_F(Test_Graph_Simplifier, BiasGeluSubGraph) {
test("bias_gelu", "Gelu");
}
and found that:
- Before the merge of Commutative rules for DNN subgraphs fusion #24483 (Cummutative rules), layer types after simplification are correct, which are
{ "Gelu", "NaryEltwise" }. - After the merge of Commutative rules for DNN subgraphs fusion #24483 (Cummutative rules), layer types are incorrect, which are
{ "Erf", "NaryEltwise" }. - Also tried latest code, and it is the same result as the above 2.
Steps to reproduce
Download model and add the test case.
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
Reactions are currently unavailable