-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Improve ONNX tracing support for Faster-RCNN #2060
Improve ONNX tracing support for Faster-RCNN #2060
Conversation
Could you add a unittest that would have failed before? Otherwise it's not clear to me what this PR is trying to fix. |
These tests show the problems that arise when exporting the ROI Pooling layer with plain ONNX.
So, I've been trying to add a unittest that shows the problem (at least for the ROIPooler). It requires an extra dependency (onnxruntime) which seems to be broken on MacOS. The pipeline fails during an import inside of onnxruntime (it for some reason can't import a function to retrieve the available backends). |
(pred_ctr_y + 0.5 * pred_h).unsqueeze(dim=-1), # y2 | ||
], | ||
dim=-1, | ||
).flatten(1) |
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.
fyi, I'm only waiting to first get the fix pytorch/pytorch#45828 into pytorch so we don't have to do this hack
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.
@ppwwyyxx has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: Small fixes to better preserve the origin of shape information during ONNX export. This resolves an issue where an ONNX export would generate fixed sized tensors for tensors that are actually of a dynamic shape. Pull Request resolved: #2060 Reviewed By: theschnitz Differential Revision: D24156111 Pulled By: ppwwyyxx fbshipit-source-id: 34776d4b18be6915b9deea6bd2cbb7680ffc6488
FYI we also hide the changes to |
Small fixes to better preserve the origin of shape information during ONNX export. This resolves an issue where an ONNX export would generate fixed sized tensors for tensors that are actually of a dynamic shape.