Skip to content

Commit

Permalink
Fix assertion in EfficientNMSPlugin
Browse files Browse the repository at this point in the history
Documentation states:
```cpp
    // Shape of boxes input should be
    // [batch_size, num_boxes, 4] or [batch_size, num_boxes, 1, 4] or [batch_size, num_boxes, num_classes, 4]
```
however, the second possibility `[batch_size, num_boxes, 1, 4]` triggers a false positive in an
assertion. The third dimension must be either equal to 1 or the number
of classes.

Signed-off-by: Stephan Seitz <[email protected]>
  • Loading branch information
theHamsta authored and rajeevsrao committed Sep 22, 2021
1 parent eb8442d commit 5a44e7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/efficientNMSPlugin/efficientNMSPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ void EfficientNMSPlugin::configurePlugin(
}
else
{
ASSERT(in[0].desc.dims.d[2] == mParam.numClasses);
ASSERT(in[0].desc.dims.d[3] == 4);
mParam.shareLocation = (in[0].desc.dims.d[2] == 1);
ASSERT(in[0].desc.dims.d[2] == mParam.numClasses || mParam.shareLocation);
ASSERT(in[0].desc.dims.d[3] == 4);
mParam.numBoxElements = in[0].desc.dims.d[1] * in[0].desc.dims.d[2] * in[0].desc.dims.d[3];
}
mParam.numAnchors = in[0].desc.dims.d[1];
Expand Down

0 comments on commit 5a44e7b

Please sign in to comment.