Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

zihaomu
Copy link
Member

@zihaomu zihaomu commented Mar 14, 2023

Bug #23351
The Conv_Add fusion strategy wants to bypass the biasLayerData(Add layer). But the strategy only works when its consumer size is 1.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

// fuse naryEltwise layer
// bias must already be computed to fuse => bias layer must appear before convolution
if (biasLayerData->id < ld.id)
if (biasLayerData->id < ld.id && biasLayerData->consumers.size() == 1)
Copy link
Member Author

@zihaomu zihaomu Mar 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Conv_Add fusion strategy wants to bypass the biasLayerData(Add layer). But the strategy only works when its consumer size is 1.

Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov self-assigned this Mar 14, 2023
@asmorkalov
Copy link
Contributor

@WanliZhong Could you try the fix on your model.

@asmorkalov asmorkalov requested a review from WanliZhong March 14, 2023 12:28
@asmorkalov asmorkalov added this to the 4.8.0 milestone Mar 14, 2023
Copy link
Member

@WanliZhong WanliZhong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍The results are right and stable.

image

@asmorkalov asmorkalov merged commit ccbc784 into opencv:4.x Mar 14, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inference result of the ONNX model is different every time with the same input

3 participants