TensorRT on Xavier: ERROR: (Unnamed Layer* 0) [Convolution]: at least 5 dimensions are required for input

I have created an onnx model that successfully with TensorRT 7 on my host machine, but it gives the following error on AGX Xavier (Jetpack 4.3).

[TensorRT] ERROR: (Unnamed Layer* 0) [Convolution]: at least 5 dimensions are required for input
Traceback (most recent call last):
File “run.py”, line 49, in
engine = backend.prepare(model, device=‘CUDA:0’)
File “/home/yaak/onnx-tensorrt/onnx_tensorrt/backend.py”, line 200, in prepare
return TensorRTBackendRep(model, device, **kwargs)
File “/home/yaak/onnx-tensorrt/onnx_tensorrt/backend.py”, line 86, in init
raise RuntimeError(msg)
RuntimeError: While parsing node number 1:
builtin_op_importers.cpp:695 In function importBatchNormalization:
[6] Assertion failed: scale_weights.shape == weights_shape

On AGX Xavier, I have followed the instructions at https://github.com/onnx/onnx-tensorrt/tree/6.0-full-dims
and I have also installed the TensorRT 6.0 open source libaries and onnx 1.5.0.

The model is open source (r2plus1d_34_clip32_ft_kinetics_from_ig65m-ade133f1.pth] and is taken from https://github.com/moabitcoin/ig65m-pytorch

I have converted the .pth to .onnx using torch 1.2.0 (also using the 1.3 gives the same error)
And used the following script to build a trt engine for it:

import onnx
import onnx_tensorrt.backend as backend
import numpy as np

model = onnx.load(“r2plus1d_34_clip32_ft_kinetics_from_ig65m-10f4c3bf.onnx”)
engine = backend.prepare(model, device=‘CUDA:0’)
input_data = np.random.random(size=(1, 3, 32, 224, 224)).astype(np.float32)
output_data = engine.run(input_data)[0]

I appreciate it if you can help me resolving this error.



Just want to clairfy first.

Do you mean you can run the same script(ONNX->TRT) on the desktop environment without issue?

If yes, would you mind to give JetPack4.4 a try.
The package also includes TensorRT 7.1.