Skip to content

dnn: missed fusion opportunities by using case-sensitive string comparisions to identify layer types #16877

@YashasSamaga

Description

@YashasSamaga
System information (version)
Detailed description
[FORWARD] Convolution 557
[SKIPPED] BatchNorm 558
[FORWARD] Relu 559
[FORWARD] Convolution 560
[FORWARD] Convolution 561
[SKIPPED] BatchNorm 562
[FORWARD] Relu 563
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 because Relu is not the same as ReLU for a case-sensitive string comparison which is what fuseLayers uses to identify layers for fusion.

Steps to reproduce

ONNX model (taken from #16869)

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions