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

Cannot convert MaskRCNN onnx model to TensorRT #604

Open
oriolorra opened this issue Apr 20, 2023 · 0 comments
Open

Cannot convert MaskRCNN onnx model to TensorRT #604

oriolorra opened this issue Apr 20, 2023 · 0 comments
Labels

Comments

@oriolorra
Copy link

Bug Report

Which model does this pertain to?

MaskRCNN-10.onnx

Describe the bug

I am trying to use tensorrt as a backend with onnx_tensorrt. I have this little piece of python code

import onnx
import onnx_tensorrt.backend as backend
import numpy as np

filename = "MaskRCNN-10.onnx"
model = onnx.load(filename)
onnx.checker.check_model(model)


model = onnx.load(filename)
engine = backend.prepare(model, device='CUDA:0')

Then, I have this error:

RuntimeError: While parsing node number 902:
ModelImporter.cpp:168 In function parseGraph:
[6] Invalid Node - 908
This version of TensorRT only supports input K as an initializer. Try applying constant folding on the model using Polygraphy: https://github.com/NVIDIA/TensorRT/tree/master/tools/Polygraphy/examples/cli/surgeon/02_folding_constants

So, I try what it says, and execute this command:

polygraphy surgeon sanitize MaskRCNN-10.onnx --fold-constants  -o folded.onnx

But, after execute this python code

import onnx
import onnx_tensorrt.backend as backend
import numpy as np

filename = "MaskRCNN-10.onnx"
model = onnx.load(filename)
onnx.checker.check_model(model)


model = onnx.load("folded10.onnx")
engine = backend.prepare(model, device='CUDA:0')

Says more or less the same error:

RuntimeError: While parsing node number 609:
ModelImporter.cpp:168 In function parseGraph:
[6] Invalid Node - 908
This version of TensorRT only supports input K as an initializer. Try applying constant folding on the model using Polygraphy: https://github.com/NVIDIA/TensorRT/tree/master/tools/Polygraphy/examples/cli/surgeon/02_folding_constants

Reproduction instructions

System Information

Ubuntu 22.04
Python 3.10.6
Onnx 1.14.0
OnnxTensorRT 8.5.1

Notes

Any additional information

@oriolorra oriolorra added the bug label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant