Tensorrt: bugs for "release/6.0" on "Add new GridAnchorRect_TRT plugin to support rectangular feature maps."

Created on 1 Dec 2019  路  7Comments  路  Source: NVIDIA/TensorRT

If using different input size (such as 600x300), with "GridAnchorRect_TRT", the outputs are wrong.
we use a featuremaps of "featureMapShapes=[19, 38, 10, 19, 5, 10, 3, 5, 2, 3, 1, 2])#600x300". There are couple of bugs:

  1. "plugin/gridAnchorPlugin/gridAnchorPlugin.cpp" line 449 check "ASSERT(numExpectedLayers == numLayers);" will always be wrong because of 2 bugs:
    1) line 386, "const bool isFMapRect = (GRID_ANCHOR_PLUGIN_NAMES[1] == name);" will always be "False". This may be changed to "const bool isFMapRect = (std::string(GRID_ANCHOR_PLUGIN_NAMES[1] )== name);"
    2) GRID_ANCHOR_PLUGIN_NAMES[1] is "GridAnchorRect_TRT", but name is "GridAnchor". Thus the check will always end up with "False".

Even if we resolve such issues, the output bounding boxes are still not correct, and not sure how the problems come from.

Plugins 6.x bug

Most helpful comment

I used a squared size (300x300) and the plugin worked fine, but now I am using a different input size (240 height x 360 width) with "GridAnchorRect_TRT" and the output predictions are wrong. I use the following configuration to create the trt plugin:

PriorBox = gs.create_plugin_node(
    name="MultipleGridAnchorGenerator",
    op="GridAnchorRect_TRT",
    minSize=0.2,
    maxSize=0.95,
    aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
    variance=[0.1, 0.1, 0.2, 0.2],
    featureMapShapes=[
        15,
        23,
        8,
        12,
        4,
        6,
        2,
        3,
        1,
        2,
        1,
        1,
    ],  
    numLayers=6,
)

And I get these weird/mirrored predictions:

mirror

Obviously the bounding box coordinates are wrongly encoded/decoded from the anchors.

I think that GridAnchorRect_TRT is a fundamental plugin for real world applications, and it needs a fix asap.

All 7 comments

@rajeevsrao for bug with this plugin. Also FWIW, this commit wasn't included in release/7.0 or master branch.

@fshi98 can you please attach sample code to repro the issue you are seeing for 2 (assuming the plugin must be registered under GridAnchorRect_TRT)? Also, did you check if sampleUffSSD (which uses GridAchorRect_TRT) works?

Closing since no response. Will re-open if necessary.

I used a squared size (300x300) and the plugin worked fine, but now I am using a different input size (240 height x 360 width) with "GridAnchorRect_TRT" and the output predictions are wrong. I use the following configuration to create the trt plugin:

PriorBox = gs.create_plugin_node(
    name="MultipleGridAnchorGenerator",
    op="GridAnchorRect_TRT",
    minSize=0.2,
    maxSize=0.95,
    aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
    variance=[0.1, 0.1, 0.2, 0.2],
    featureMapShapes=[
        15,
        23,
        8,
        12,
        4,
        6,
        2,
        3,
        1,
        2,
        1,
        1,
    ],  
    numLayers=6,
)

And I get these weird/mirrored predictions:

mirror

Obviously the bounding box coordinates are wrongly encoded/decoded from the anchors.

I think that GridAnchorRect_TRT is a fundamental plugin for real world applications, and it needs a fix asap.

@rmccorm4 do you mind re-opening it?

@fshi98 @edumotya can you please verify if this resolves the issue: https://github.com/NVIDIA/TensorRT/pull/679

Well @rajeevsrao , now the uff parser does not find the plugin:

[TensorRT] ERROR: UffParser: Validator error: MultipleGridAnchorGenerator: Unsupported operation _GridAnchorRect_TRT

I am creating the plugin node using this code:

PriorBox = gs.create_plugin_node(
        name="MultipleGridAnchorGenerator",
        op="GridAnchorRect_TRT",
        minSize=0.2,
        maxSize=0.95,
        aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
        variance=[0.1, 0.1, 0.2, 0.2],
        featureMapShapes=[40, 23, 20, 12, 10, 6, 5, 3, 3, 2, 2, 1],
        numLayers=6,
)

I started from the container nvcr.io/nvidia/deepstream-l4t:5.0-20.07-base. I also tried to rebuild the TensorRT OSS components on Jetson from the master branch, with no success, the error was the same. I am using TensorRT version: 7.1.3, library version: 7.

Am I doing something wrong? Do you have any clues?


EDIT: I have opened a new issue for this 807

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sbbug picture sbbug  路  5Comments

anmol039w picture anmol039w  路  5Comments

MachineJeff picture MachineJeff  路  5Comments

dhkim0225 picture dhkim0225  路  6Comments

AlphaJia picture AlphaJia  路  3Comments