Skip to content

TensorRT cannot support nonzero,Is there any other alternative to this function? #2285

@puallee

Description

@puallee

the code in Pytorch is :indices = mask.nonzero(as_tuple=False)[:, 0],
the error in TensorRT is:
[08/23/2022-10:06:28] [I] [TRT] No importer registered for op: NonZero. Attempting to import as plugin.
[08/23/2022-10:06:28] [I] [TRT] Searching for plugin: NonZero, plugin_version: 1, plugin_namespace:
[08/23/2022-10:06:28] [E] [TRT] ModelImporter.cpp:773: While parsing node number 84 [NonZero -> "onnx::Transpose_634"]:
[08/23/2022-10:06:28] [E] [TRT] ModelImporter.cpp:774: --- Begin node ---
[08/23/2022-10:06:28] [E] [TRT] ModelImporter.cpp:775: input: "onnx::NonZero_629"
output: "onnx::Transpose_634"
name: "NonZero_559"
op_type: "NonZero"

[08/23/2022-10:06:28] [E] [TRT] ModelImporter.cpp:776: --- End node ---
[08/23/2022-10:06:28] [E] [TRT] ModelImporter.cpp:779: ERROR: builtin_op_importers.cpp:4890 In function importFallbackPluginImporter:
[8] Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
[08/23/2022-10:06:28] [E] Failed to parse onnx file
[08/23/2022-10:06:28] [I] Finish parsing network model
[08/23/2022-10:06:28] [E] Parsing model failed
[08/23/2022-10:06:28] [E] Failed to create engine from model or file.
[08/23/2022-10:06:28] [E] Engine set up failed

Metadata

Metadata

Labels

triagedIssue has been triaged by maintainers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions