-
Notifications
You must be signed in to change notification settings - Fork 642
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
[Fix] Fix reppoints TensorRT support. #1060
Conversation
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.
In my env:
torch 1.10.0 + cu113
tensorrt 8.4.2.4
This conversion will failed on onnx2tensorrt.
[TRT] [W] Skipping tactic 0x0000000000000000 due to Myelin error: autotuning: CUDA error 3 allocating 0-byte buffer:
[09/27/2022-11:10:30] [TRT] [E] 4: [optimizer.cpp::computeCosts::3624] Error Code 4: Internal Error (Could not find any implementation for node {ForeignNode[Transpose_600 + Reshape_603...Gather_1063]} due to insufficient workspace. See verbose log for requested sizes.)
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.
And in another env:
tensorrt 8.0.3.4
pytorch 1.8.0+cuda102:
It fails at:
RuntimeError: Failed to parse onnx, In node 1061 (importClip): UNSUPPORTED_NODE: Assertion failed: inputs.at(2).is_weights() && "Clip max value must be an initializer!"
LGTM. |
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.
LGTM.
# TODO: figure out why we can't reshape after permute deirectly | ||
bbox_pred = bbox_pred.permute(0, 2, 3, 1) | ||
bbox_pred = bbox_pred.reshape(batch_size, -1) | ||
bbox_pred = (bbox_pred + 0).reshape(batch_size, -1, 4) |
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.
Why add +0
?
@@ -115,7 +118,11 @@ def reppoints_head__get_bboxes(ctx, | |||
scores = scores.sigmoid() | |||
else: | |||
scores = scores.softmax(-1) | |||
bbox_pred = bbox_pred.permute(0, 2, 3, 1).reshape(batch_size, -1, 4) | |||
|
|||
# TODO: figure out why we can't reshape after permute deirectly |
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.
deirectly
--> directly
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1060 +/- ##
=======================================
Coverage 47.71% 47.72%
=======================================
Files 323 323
Lines 11312 11314 +2
Branches 1619 1619
=======================================
+ Hits 5398 5400 +2
Misses 5526 5526
Partials 388 388
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
Reppoint give wrong result on latest TensorRT.
Modification
Reshape twice.
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