I am trying to load and serialize an ONNX-Model with 5D inputs [batch, a, x, y, z] and there should be no problem since the dynamic batch dimension is supported. Unfortunately the nvinfer1::Dims does not support Dims5, so I added the new class Dims5 inside NvInferLegacyDims.h (no need to recompile libnvinfer*.so since no dependencies change). Then I encountered the following error during serialization,
[E] [TRT] 4: [network.cpp::validate::2716] Error Code 4: Internal Error (input_tensor_name: number of dimensions is 5 but profile 0 has 4.) [E] [TRT] 2: [builder.cpp::buildSerializedNetwork::417] Error Code 2: Internal Error (Assertion enginePtr != nullptr failed.)
and it seems the profile within buildSerializedNetwork only reads up to 4 input dimensions even though it could be 5, hence the serialization fails as shown above. The builder.cpp is not part of TensorRT OSS so I cannot investigate more.
- Do TensorRT really support 5D input tensor? If yes, why there is not Dims5 available since the maximum tensor size is already fixed to 8?
- Is there ways or alternative to properly load/serialize model with 5 or more input dimensions?
TensorRT Version: 8.0.1-6
GPU Type: RTX2070
Nvidia Driver Version: 460.91.03
CUDA Version: 11.3.0
CUDNN Version: 8.2.1
Operating System + Version: Ubuntu20.04
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):
No codes or model since I want to get more explanation first regarding the asked topic.