onnx-tensorrt
onnx-tensorrt copied to clipboard
When will Mod op be supported
[02/16/2022-07:17:27] [I] [TRT] No importer registered for op: Mod. Attempting to import as plugin. [02/16/2022-07:17:27] [I] [TRT] Searching for plugin: Mod, plugin_version: 1, plugin_namespace: [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:780: While parsing node number 101 [Mod -> "Mod__89:0"]: [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:781: --- Begin node --- [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:782: input: "Reshape__87:0" input: "Slice__83:0" output: "Mod__89:0" name: "Mod__89" op_type: "Mod" domain: ""
[02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:783: --- End node --- [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:785: ERROR: parsers/onnx/builtin_op_importers.cpp:4870 In function importFallbackPluginImporter:
Hi, When will the Mod op be supported?
This is on our roadmap and will be supported in a future TensorRT release
I have same question, I want to know how to add this function?Thanks!
I solved this problems temporarily by replace the mod % operation with the following function:
def mod(a, b):
out = a - a // b * b
return out
example:
a % b
replaced with
mod(a, b)
[02/16/2022-07:17:27] [I] [TRT] No importer registered for op: Mod. Attempting to import as plugin. [02/16/2022-07:17:27] [I] [TRT] Searching for plugin: Mod, plugin_version: 1, plugin_namespace: [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:780: While parsing node number 101 [Mod -> "Mod__89:0"]: [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:781: --- Begin node --- [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:782: input: "Reshape__87:0" input: "Slice__83:0" output: "Mod__89:0" name: "Mod__89" op_type: "Mod" domain: ""
[02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:783: --- End node --- [02/16/2022-07:17:27] [E] [TRT] parsers/onnx/ModelImporter.cpp:785: ERROR: parsers/onnx/builtin_op_importers.cpp:4870 In function importFallbackPluginImporter:
Hi, When will the Mod op be supported?
It seems that Mod is already supported in TensorRT 8.5 GA (#880). Maybe you can upgrade to the latest version and try again.
I solved this problems temporarily by replace the mod
%operation with the following function:def mod(a, b): out = a - a // b * b return outexample:
a % breplaced with
mod(a, b)
Where did you make the change?