Description
Unable to use ISlice layer for padding a tensor
I am trying to use the ISlice Layer with Tensorrt v8.2.1, since IPaddingLayer is going to be deprecated. I am trying to convert a tensor of shape 1,3,10,10(N,C,H,W) to 1,3,14,14(N,C,H,W) with padding done to top, bottom ,left and right of the tensor. I am trying to use the below code snippet but unsuccesful
ISliceLayer* slice = network->addSlice(*InputLayerITensor,
Dims4{0,0,0,0},
Dims4{1,3,14,14},
Dims4{1,1,-2,-2});
I see error
Error occured when invoking TensorRT API
4: (Unnamed Layer* 0) [Slice]: out of bounds slice, input dimensions = [1,3,10,10], start = [0,0,0,0], size = [1,3,14,14], stride = [1,1,-2,-2].
Error occured when invoking TensorRT API
4: [network.cpp::validate::2871] Error Code 4: Internal Error (Layer (Unnamed Layer* 0) [Slice] failed validation)
Any help in usage of this API for my requirements is highly appreciated.
Environment
TensorRT Version: Tensorrt v 8.2.1
GPU Type: Titan xp
Nvidia Driver Version: cuda 11.2
CUDA Version: cuda 11.2
CUDNN Version: 8.2.1
Operating System + Version: Linux
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):
Relevant Files
Steps To Reproduce
Build Makefile using the executable. attached in the zip and run the exe.
Please include:
Build Makefile using the executable. attached in the zip and run the exe.