-
-
Notifications
You must be signed in to change notification settings - Fork 55.7k
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
dnn: missed fusion opportunities by using case-sensitive string comparisions to identify layer types #16877
Comments
That's interesting. But how layer "Relu" is initialized while only "ReLU" is supported? I though it should throw something like opencv/modules/dnn/src/dnn.cpp Line 539 in 78c5e41
source: opencv/modules/dnn/src/init.cpp Line 100 in 78c5e41
In example, for TensorFlow there is even remap for origin types: opencv/modules/dnn/src/tensorflow/tf_importer.cpp Lines 2166 to 2171 in ca23c0e
Can reproduce that layer types are weird:
(tested on CPU but it matches by |
I couldn't find ONNX importer code using Here is my guess on how this bug might have happened. You can find The ONNX importer uses the type name from opencv/modules/dnn/src/onnx/onnx_importer.cpp Lines 323 to 324 in 760e9e0
Layer factory uses opencv/modules/dnn/src/dnn.cpp Lines 4985 to 5003 in 760e9e0
So even irrespective of whether the type is |
Please take a look at #16878. |
System information (version)
Detailed description
code to obtain the above skipped/forward summary
`std::cout << (ld.skip ? "[SKIPPED]" : "[FORWARD]") << ' ' << ld.type << ' ' << ld.name << std::endl;`in
forwardLayer
Relu
layers are not fused with convolution. It's becauseRelu
is not the same asReLU
for a case-sensitive string comparison which is whatfuseLayers
uses to identify layers for fusion.Steps to reproduce
ONNX model (taken from #16869)
Issue submission checklist
answers.opencv.org, Stack Overflow, etc and have not found solution
The text was updated successfully, but these errors were encountered: