Unsupported operation 'if' in Tensorrt 7.0.0

Description

I made made a custom model and converted it to ONNX.
It uses ‘if’ operation and ‘reverse sequence’ operation which are unsupported in TensorRT 7.0.0

But ‘if’ operation is supported in TensorRT 7.1.0.
So, may I when Nvidia will be releasing 7.1.0 OSS becuase then I’ll just have to implement ‘reverse sequence layer’ or if there is another way to implement layer without TRT source code. please share.

trtexec Logs:
log.txt (137.2 KB)

Environment

TensorRT Version: 7.1.0/7.0.0
CUDA Version: 10.2
Operating System + Version: Jetpack 4.4 DP

Hello @pickleRick,
TensorRT 7.1.0 does not support ‘if’ and ‘reverseSequence’ operation. You can find the list of supported operators in the link below-

However if you wish to implement reverse sequence layer, you may use a custom plugin for the same.
Please find the link for reference.

Thanks!

Then why I’m not getting ‘if’ operation error when using TRT 7.1.0 and getting it when I’m using 7.0.0?

Did you add parser of ‘if’ in ONNX parser in 7.1.0?

Hi,
‘If’ operator is not supported in Onnx parser in R7.1.0.

Can you please help us with your model and verbose logs so that we can assist you better.
Thanks!

I’ve attached the logs below.

logs_7.0.0_OSS.txt (45.9 KB)

logs_7.1.0.txt (84.1 KB)

Onnx model file

This issue is solved now.

If operations were added because we used keras api in TF to build the model and tf2onnx to convert to onnx. Instead, we should have used keras2onnx.

Using keras2onnx solves this problem. but still doesn’t explain why we don’t get any unsupported op ‘if’ when using 7.1.0?

Now I’m getting a different error.

[8] Assertion failed: std::equal(activationAlphas.begin(), activationAlphas.begin() + NUM_ACTIVATIONS, activationAlphas.begin() + NUM_ACTIVATIONS) && "The parser does not currently support cases where activations for the reverse pass of the LSTM do not match the forward pass."

I think I’ll start a different topic for this issue.