Description
I used trtexec to load onnx model produced by tf2onnx, but the execution is failed:
[08/18/2021-21:47:20] [V] [TRT] Searching for input: rnn_2_1/gru2/while/strided_slice:0
[08/18/2021-21:47:20] [E] Error[9]: [graph.cpp::computeInputExecutionUses::510] Error Code 9: Internal Error ((Unnamed Layer* 355) [Recurrence]: IRecurrenceLayer cannot be used to compute a shape tensor)
[08/18/2021-21:47:20] [V] [TRT] rnn_2_1/gru2/while/strided_slice__230 [Squeeze] inputs: [rnn_2_1/gru2/while/strided_slice:0 → ()[FLOAT]],
[08/18/2021-21:47:20] [E] Error[9]: [graph.cpp::computeInputExecutionUses::510] Error Code 9: Internal Error ((Unnamed Layer* 355) [Recurrence]: IRecurrenceLayer cannot be used to compute a shape tensor)
[08/18/2021-21:47:20] [E] [TRT] /root/code/code/TensorRT/parsers/onnx/ModelImporter.cpp:725: While parsing node number 119 [Scan → “custom_rnn_scan_Scan__61:0”]:
[08/18/2021-21:47:20] [E] [TRT] /root/code/code/TensorRT/parsers/onnx/ModelImporter.cpp:726: — Begin node —
[08/18/2021-21:47:20] [E] [TRT] /root/code/code/TensorRT/parsers/onnx/ModelImporter.cpp:727: input: “rnn_2_1/gru2/VecAttGRUCellZeroState/zeros:0”
Environment
TensorRT Version: 8.0
GPU Type: T4-8C
Nvidia Driver Version: 450.102.04
CUDA Version: 11.0
CUDNN Version: 7.0
Operating System + Version: Linux VM-116-42-centos 3.10.107-1-tlinux2_kvm_guest-004
Relevant Files
full logs:
a.txt (194.4 KB)
Steps To Reproduce
python -m tf2onnx.convert --saved-model ./ --output model_11.onnx --opset 11
./trtexec --onnx=model_11.onnx --verbose
about my model:
According to the logs, the error occured when parsing custom_rnn_scan_Scan__61:0. I guess the meaning is that the output of this node cannot be used as shape(such as reshape OP), but the upcoming nodes are almost Matmul or Bias (without any shape OP).
Besides, I have tried almost all TensorRT versions( 7.1 7.2 8.0), and tried the ONNX IR versions with 8, 9, 11 and 13. However, the errors still exists.
Can anybody provide some tips about it?