Description
I try conver a pytorch model to TensorRT, Pytorch->onnx->TensorRT.
I convert the model to onnx succefully, but when I try to convert onnx to TensorRT using trtexec, I got :
[6] Invalid Node - Pad_14
[shuffleNode.cpp::symbolicExecute::387] Error code 4: Internal Error (Reshape_3: IShuffleLayer applied to shape tensor must have 0 or 1 reshape dimensions: dimensions were [-1,2]
I inspect the model by netron:
It seems the pytorch function F.pad get the incompatib node.
The first step in forward() is :
h, w = x.shape[-2:]
extra_h = (math.ceil(w / self.stride[1]) - 1) * self.stride[1] - w + self.kernel_size[1]
extra_v = (math.ceil(h / self.stride[0]) - 1) * self.stride[0] - h + self.kernel_size[0]
left = extra_h // 2
right = extra_h - left
top = extra_v // 2
bottom = extra_v - top
x = F.pad(x, [left, right, top, bottom])
x = self.conv(x)
Is the problem due to F.pad() function or any other reason?
Environment
TensorRT Version: 8.2.3.0
GPU Type: RTX3060Ti
Nvidia Driver Version: 470.86
CUDA Version: 11.3
CUDNN Version: 8.2.1.32
Operating System + Version:
Python Version (if applicable): 3.7
TensorFlow Version (if applicable):
PyTorch Version (if applicable): 1.10
Baremetal or Container (if container which image + tag):
Relevant Files
Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)
Steps To Reproduce
Please include:
- Exact steps/commands to build your repro
- Exact steps/commands to run your repro
- Full traceback of errors encountered