fabio-sim/LightGlue-ONNX

error when convert tensorRt engine model

long-senpai opened this issue · 4 comments

Hello, thank you for the great work about Lightglue Onnx. I want to convert the Onnx model to tensorRt to run in the c++ application. Howerver, i got this errors when.i used the trt_infer.py to build the engine file.
`[02/06/2024-19:26:59] [TRT] [W] onnx2trt_utils.cpp:375: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
[02/06/2024-19:26:59] [TRT] [W] onnx2trt_utils.cpp:403: One or more weights outside the range of INT32 was clamped
[02/06/2024-19:26:59] [TRT] [E] ModelImporter.cpp:726: While parsing node number 177 [LayerNormalization -> "/transformers.0/self_attn/ffn/ffn.1/LayerNormalization_output_0"]:
[02/06/2024-19:26:59] [TRT] [E] ModelImporter.cpp:727: --- Begin node ---
[02/06/2024-19:26:59] [TRT] [E] ModelImporter.cpp:728: input: "/transformers.0/self_attn/ffn/ffn.0/Add_output_0"
input: "transformers.0.self_attn.ffn.1.weight"
input: "transformers.0.self_attn.ffn.1.bias"
output: "/transformers.0/self_attn/ffn/ffn.1/LayerNormalization_output_0"
name: "/transformers.0/self_attn/ffn/ffn.1/LayerNormalization"
op_type: "LayerNormalization"
attribute {
name: "axis"
i: -1
type: INT
}
attribute {
name: "epsilon"
f: 1e-05
type: FLOAT
}

[02/06/2024-19:26:59] [TRT] [E] ModelImporter.cpp:729: --- End node ---
[02/06/2024-19:26:59] [TRT] [E] ModelImporter.cpp:731: ERROR: builtin_op_importers.cpp:5427 In function importFallbackPluginImporter:
[8] Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
In node 177 (importFallbackPluginImporter): UNSUPPORTED_NODE: Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
Traceback (most recent call last):
File "trt_infer.py", line 119, in
build_engine(model_path, output_path)
File "trt_infer.py", line 30, in build_engine
raise Exception
Exception`

My system information:
Jetson Orin Jetpack 5.1.1 Cuda 11.4 and TensorRT version is 8.5.2.2.
i installed all the requirements following the requirement file in your repo.
Can you give me some advice?

Hi @long-senpai, thank you for your interest in LightGlue-ONNX.

I think this is due to LayerNormalization being available only after TensorRT 8.6.

Hi @long-senpai, thank you for your interest in LightGlue-ONNX.

I think this is due to LayerNormalization being available only after TensorRT 8.6.

I use TensorRT 8.6.1, but also have same error.