TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Assertion Error in getSupportedFormats: 0 (!formats.empty(), when converting onnx to tensorrt

Open v-qjqs opened this issue 5 years ago • 7 comments

Description

When converting my exported onnx model (which contains my customized tensorrt plugin) to tensort, I got the following error: [TensorRT] ERROR: ../builder/cudnnBuilder2.cpp (2032) - Assertion Error in getSupportedFormats: 0 (!formats.empty()). For more details about the verbose log, see the below: WXWorkCapture_16241967018763

Please help me, thanks very much.

Environment

TensorRT Version: 7.2.1.6 NVIDIA GPU: GeForce GTX 1660 NVIDIA Driver Version: 440.33.01 CUDA Version: 10.2 CUDNN Version: 8.0.5 Operating System: Ubuntu 16.04 Python Version (if applicable): 3.7.10 PyTorch Version (if applicable): 1.6+cuda102

v-qjqs avatar Jun 20 '21 13:06 v-qjqs

Hi, any comments?

v-qjqs avatar Jun 29 '21 12:06 v-qjqs

@v-qjqs , Is this error only occur when the network contains your plugin? If so could you check your supportsFormatCombination implementation in your plugin, thanks!

ttyio avatar Jul 06 '21 07:07 ttyio

Hi @ttyio, thanks for your reply! Yes, this error only occur when the network contains my customized cumsum plugin. The plugin uses x and axis as it's inputs:y=cumsum(x,axis), and the following is the implementation of my supportsFormatCombination, but I'm not sure about how to handle the dtype and format for axis: issue_cumsum

Looking forward to your replies!

v-qjqs avatar Jul 06 '21 13:07 v-qjqs

Hello @v-qjqs , the supportsFormatCombination seems correct to me, maybe you need debug to check what is the datatype and format is passed down from TRT.

BTW CumSum is already support onnx op in 8.0, see https://github.com/onnx/onnx-tensorrt/blob/8fea430fc1ad452085add61b04045a9efbf2b981/docs/operators.md, could you take a try? thanks

ttyio avatar Jul 07 '21 09:07 ttyio

Hi @ttyio, thanks for your kind reply. Yes, CumSum is already supported in trt8, while not for trt7.2. And I need to use trt7.2 on my experiments, so my customized implementation of this plugin should be used. From the above verbose log, I wonder whether we could conclude that which input (x or axis) causes the above error? On my experiments, x is a 3-D tensor with shape (batch_size, height, width) and axis is a scale int. Thanks very much.

v-qjqs avatar Jul 07 '21 10:07 v-qjqs

Hello @v-qjqs , yes you can set breakpoint or print all the coming datatype, layout in the supportsFormatCombination API.

Also, you could take a try to copy the cumsum from 8.0 parser to 7.2, I don't think there is TRT core part change for the cumsum implementation, https://github.com/onnx/onnx-tensorrt/blob/8fea430fc1ad452085add61b04045a9efbf2b981/builtin_op_importers.cpp#L872

Thanks

ttyio avatar Jul 08 '21 00:07 ttyio

Closing since no activities for more than 3 weeks, please reopen if you still have question. Thanks!

ttyio avatar Aug 02 '21 08:08 ttyio