Skip to content

DNN: BiasAdd tf_importer.cpp could load Const from First Place#20686

Merged
alalek merged 1 commit intoopencv:3.4from
zihaomu:tf_biasadd_bug
Sep 11, 2021
Merged

DNN: BiasAdd tf_importer.cpp could load Const from First Place#20686
alalek merged 1 commit intoopencv:3.4from
zihaomu:tf_biasadd_bug

Conversation

@zihaomu
Copy link
Copy Markdown
Member

@zihaomu zihaomu commented Sep 10, 2021

parseBiasAdd in tf_importer.cpp can only load Const from Second place, and the default input layer is the first one.
But the following Tensorflow code will produce Const in the First Place. At this point, the input layer is the Second one.

inp = tf.placeholder(tf.float32, [1, 2, 3, 4], 'input')
sub = 3.0 - inp

The test data could be found at PR of opencv_extra.

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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

@alalek
Copy link
Copy Markdown
Member

alalek commented Sep 10, 2021

Thank you for contribution!

This patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

P.S. Please update opencv_extra's PR too.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Thank you 👍

@alalek alalek merged commit 696a6cc into opencv:3.4 Sep 11, 2021
@alalek alalek mentioned this pull request Sep 11, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
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.

2 participants