onnx-tensorrt icon indicating copy to clipboard operation
onnx-tensorrt copied to clipboard

When will Mod op be supported

Open sun2011yao opened this issue 3 years ago • 5 comments

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

sun2011yao avatar Feb 16 '22 07:02 sun2011yao

This is on our roadmap and will be supported in a future TensorRT release

kevinch-nv avatar Feb 22 '22 17:02 kevinch-nv

I have same question, I want to know how to add this function?Thanks!

rucieryi369 avatar Apr 07 '22 09:04 rucieryi369

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)

amadeusneko avatar Apr 15 '22 09:04 amadeusneko

[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.

entropy2333 avatar Nov 07 '22 09:11 entropy2333

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)

Where did you make the change?

anudeepsekhar avatar Nov 11 '22 15:11 anudeepsekhar