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

Skip to content

Conversation

@fengyuentau
Copy link
Member

Gemm layer was refactored some time ago. Users found that the mobilenet example in https://github.com/opencv/opencv/wiki/Huawei-CANN-Backend does not work because of incorrect shape set for 1d bias in Gemm. This PR resolves this issue.

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

@fengyuentau fengyuentau added category: dnn category:dnn_cann CANN backend related issues in DNN module labels Mar 6, 2024
@fengyuentau fengyuentau added this to the 4.10.0 milestone Mar 6, 2024
@fengyuentau fengyuentau requested a review from vpisarev March 6, 2024 08:19
@asmorkalov asmorkalov requested a review from dkurt March 6, 2024 13:36
@asmorkalov
Copy link
Contributor

@dkurt @vpisarev could you take a look?

@asmorkalov asmorkalov merged commit 025e760 into opencv:4.x Mar 25, 2024
@asmorkalov
Copy link
Contributor

@fengyuentau Do you plan to propose a dedicated patch for 5.x? 1d cases may be handled differently there.

@fengyuentau fengyuentau deleted the fix_cann_gemm branch March 25, 2024 06:49
@fengyuentau
Copy link
Member Author

@fengyuentau Do you plan to propose a dedicated patch for 5.x? 1d cases may be handled differently there.

Well, I doubt that since new engine is comming soon. Let me put it in my todo list first and see whether it needs a lot effort to handle 1d case in CANN backend.

@asmorkalov asmorkalov mentioned this pull request Apr 1, 2024
klatism pushed a commit to klatism/opencv that referenced this pull request May 17, 2024
dnn (CANN): Fix incorrect shape of 1d bias in Gemm opencv#25166

Gemm layer was refactored some time ago. Users found that the mobilenet example in https://github.com/opencv/opencv/wiki/Huawei-CANN-Backend does not work because of incorrect shape set for 1d bias in Gemm. This PR resolves this issue.

### Pull Request Readiness Checklist

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

- [x] I agree to contribute to the project under Apache 2 License.
- [x] 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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:dnn_cann CANN backend related issues in DNN module category: dnn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants