Skip to content
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

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

Closed
fshi98 opened this issue Dec 1, 2019 · 7 comments · Fixed by #679
Assignees
Labels
Plugins Issues when using TensorRT plugins

Comments

@fshi98
Copy link

fshi98 commented Dec 1, 2019

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.

@rmccorm4 rmccorm4 added bug Plugins Issues when using TensorRT plugins labels Dec 29, 2019
@rmccorm4
Copy link
Collaborator

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

@rajeevsrao
Copy link
Collaborator

@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?

@rajeevsrao rajeevsrao self-assigned this Dec 31, 2019
@rmccorm4
Copy link
Collaborator

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

@edumotya
Copy link

edumotya commented May 13, 2020

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.

@edumotya
Copy link

edumotya commented Jun 3, 2020

@rmccorm4 do you mind re-opening it?

@rajeevsrao
Copy link
Collaborator

@fshi98 @edumotya can you please verify if this resolves the issue: #679

@edumotya
Copy link

edumotya commented Sep 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugins Issues when using TensorRT plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants