onnx-tensorrt
onnx-tensorrt copied to clipboard
onnx2trt giving Assertion failed: dims.nbDims == 4 || dims.nbDims == 5 error
I want to convert one pytorch model with backbone Resnet-50 to tensorrt, so first exported it to onnx and then trying onnx2trt to generate trt file. I am getting error like below:
arvind@arvind:~/util_scripts/onnx-tensorrt/build$ ./onnx2trt ../../resnet50.onnx -o resnet50_tracker_engine.trt
Input filename: ../../resnet50.onnx
ONNX IR version: 0.0.6
Opset version: 9
Producer name: pytorch
Producer version: 1.9
Domain:
Model version: 0
Doc string:
Parsing model [2021-09-02 10:02:11 WARNING] /home/arvind/util_scripts/onnx-tensorrt/onnx2trt_utils.cpp:235: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32. [2021-09-02 10:02:11 ERROR] (Unnamed Layer* 192) [Shuffle]: at most one dimension may be inferred While parsing node number 178 [BatchNormalization -> "output"]: ERROR: /home/arvind/util_scripts/onnx-tensorrt/onnx2trt_utils.cpp:1394 In function scaleHelper: [8] Assertion failed: dims.nbDims == 4 || dims.nbDims == 5
*** Need inputs on this.
Thanks in advance!
Can you provide the ONNX file you are using?