Skip to content

[Fix] Fix ascend faster-rcnn #1842

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

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

grimoire
Copy link
Member

@grimoire grimoire commented Mar 7, 2023

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Please describe the motivation of this PR and the goal you want to achieve through this PR.

Modification

Please briefly describe what modification is made in this PR.

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@lvhan028
Copy link
Collaborator

test error by executing python demo/python/object_detection.py cpu ../mmdeploy_models/mmdet/faster-rcnn/ascend/ demo/resources/det.jpg
The error log is:

 [error] [acl_net.cpp:494] Shape mismatch [1, 3, 1344, 800] vs [1, 3, 800, 1344]

The conversion command is:

 python tools/deploy.py configs/mmdet/detection/detection_ascend_static-800x1344.py ../checkpoint/faster-rcnn_r50_fpn_1x_coco.py ../checkpoint/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth demo/resources/det.jpg --dump-info --work-dir ../mmdeploy_models/mmdet/faster-rcnn/ascend

@lvhan028
Copy link
Collaborator

I tried master branch too. But got the following errors:

  File "/share/lvhan/mmdeploy/mmdeploy/core/rewriters/rewriter_utils.py", line 402, in wrapper
    return self.func(self, *args, **kwargs)
  File "/share/lvhan/mmdeploy/mmdeploy/pytorch/functions/tensor_getitem.py", line 19, in tensor__getitem__ascend
    return ctx.origin_func(self, key)
IndexError: too many indices for tensor of dimension 1

@grimoire
Copy link
Member Author

test error by executing python demo/python/object_detection.py cpu ../mmdeploy_models/mmdet/faster-rcnn/ascend/ demo/resources/det.jpg The error log is:

 [error] [acl_net.cpp:494] Shape mismatch [1, 3, 1344, 800] vs [1, 3, 800, 1344]

The conversion command is:

 python tools/deploy.py configs/mmdet/detection/detection_ascend_static-800x1344.py ../checkpoint/faster-rcnn_r50_fpn_1x_coco.py ../checkpoint/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth demo/resources/det.jpg --dump-info --work-dir ../mmdeploy_models/mmdet/faster-rcnn/ascend

use dynamic deploy config

@lvhan028
Copy link
Collaborator

test error by executing python demo/python/object_detection.py cpu ../mmdeploy_models/mmdet/faster-rcnn/ascend/ demo/resources/det.jpg The error log is:

 [error] [acl_net.cpp:494] Shape mismatch [1, 3, 1344, 800] vs [1, 3, 800, 1344]

The conversion command is:

 python tools/deploy.py configs/mmdet/detection/detection_ascend_static-800x1344.py ../checkpoint/faster-rcnn_r50_fpn_1x_coco.py ../checkpoint/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth demo/resources/det.jpg --dump-info --work-dir ../mmdeploy_models/mmdet/faster-rcnn/ascend

use dynamic deploy config

Yes. The dynamic config works. Should we still keep the static config?
#1766 talks about static config

Copy link
Collaborator

@lvhan028 lvhan028 left a comment

Choose a reason for hiding this comment

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

LGTM

@lvhan028 lvhan028 requested a review from lzhangzz March 23, 2023 05:54
@lvhan028 lvhan028 merged commit 4117aa5 into open-mmlab:dev-1.x Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants