Conversation
…idar/export_faster_rcnn
…idar/export_faster_rcnn
|
@lara-hdr can you rebase your PR on top of master? I've issued a fix to CI that should make things work. Also, I've (temporarily) made torchvision CI depend on PyTorch 1.3, so maybe we might need to disable a few tests if the PyTorch version is not greater than 1.4 (like |
Codecov Report
@@ Coverage Diff @@
## master #1401 +/- ##
==========================================
- Coverage 64.46% 63.29% -1.17%
==========================================
Files 83 83
Lines 6421 6424 +3
Branches 982 880 -102
==========================================
- Hits 4139 4066 -73
- Misses 1992 2047 +55
- Partials 290 311 +21
Continue to review full report at Codecov.
|
|
@fmassa the roi_heads test also calls transform.postprocess() at the end, so it uses the unbind. |
| pred_scores = pred_scores.split(boxes_per_image, 0) | ||
| if len(boxes_per_image) == 1: | ||
| # TODO : remove this when ONNX support dynamic split sizes | ||
| pred_boxes = (pred_boxes,) |
There was a problem hiding this comment.
What is the limitation here exactly?
There was a problem hiding this comment.
I think that ONNX exporter doesn't yet support a boxes_per_image which is dynamic, so it gets converted into a constant and thus doesn't work for different number of boxes.
This is something that will be fixed by the ONNX team I believe, and this is currently only a workaround solution (which I think shouldn't affect torchscript?)
There was a problem hiding this comment.
exactly. split is not yet supported with dynamic sizes (so boxes_per_image will be exported as a constant which will for with any new input). But we are working on supporting this scenario in the exporter
There was a problem hiding this comment.
If the length isn't 1 isn't it still dynamic ? Not getting how this isn't still dynamic.
(small change to support in TS, mostly just curious)
There was a problem hiding this comment.
it is, but we are currently only supporting a batch size of 1
In addition to #1329 and #1329, these are the last changes to be able to export faster rcnn to ONNX.
For now we will only be able to export with a batch of 1 (split in ONNX is static, but we are working on supporting dynamic cases that will allow us to export postprocess_detections in roi_heads with a batch_size > 1).
The test is disabled for now, until the 2 references PRs are merged and bilinear Resize is implemented in opset 11 to match PyTorch's interpolate.