-
-
Notifications
You must be signed in to change notification settings - Fork 56.4k
DNN: fix the issue in layer_fuse #24156
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
Conversation
modules/dnn/src/net_impl_fuse.cpp
Outdated
| String operation_text = toLowerCase(nextData->params.get<String>("operation", "sum")); | ||
| CV_LOG_DEBUG(NULL, "DNN/CPU: fusion with NaryEltwise or Eltwise Layer operation is not supported: " | ||
| << nextData->params.get<String>("operation")); | ||
| << operation_text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some compilation modes may ignore CV_LOG_DEBUG statement completely (empty macro).
We should NOT create orphaned variables which are not used (and we don't want to evaluate unused expressions and call functions).
modules/dnn/src/net_impl_fuse.cpp
Outdated
|
|
||
| if (!nextData->params.has("operation") || toLowerCase(nextData->params.get<String>("operation")) != "add") | ||
| { | ||
| String operation_text = toLowerCase(nextData->params.get<String>("operation", "sum")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"sum"
Why is sum?
<empty> should be more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix issue: #24041
relates #22401
Handling when the
operationof theElemtwise layeris missing.nextData->params.get<String>("operation")will fail when theoperationis missing. This patch adds default value for such case.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.