Problem in facing in converting custom yolo weights into TensorRT

Good Afternoon,
I am working on a project on Jetson Nano using TensorRT model, I tried to convert custom yolo weights into TensorRT. I successfully converted into ONNX file. But I failed to convert that ONNX file into TensorRT file. When I run the command it is showing errors.
python3 onnx_to_tensorrt.py -m custom-yolov4-tiny-416 --category_num 9
Loading the ONNX file…
Adding yolo_layer plugins…
Building an engine. This would take a while…
(Use “–verbose” or “-v” to enable verbose logging.)
python3: yolo_layer.cu:119: virtual nvinfer1::Dims nvinfer1::YoloLayerPlugin::getOutputDimensions(int, const nvinfer1::Dims*, int): Assertion `inputs[0].d[1] == mYoloHeight’ failed.
Aborted (core dumped)
Sir, I am enclosing the screenshot of the error.Please help me to sort out this error. Thanks in advance

Hi,

Please update the parameter based on your customized model.

onnx_to_tensorrt.py

output_shapes = [(1, 18, 13, 13), (1, 18, 26, 26), (1, 18, 52, 52)]
...
postprocessor_args = {"yolo_masks": [(6, 7, 8), (3, 4, 5), (0, 1, 2)],                    # A list of 3 three-dimensional tuples for the YOLO masks
                      "yolo_anchors": [(10, 13), (16, 30), (33, 23), (30, 61), (62, 45),  # A list of 9 two-dimensional tuples for the YOLO anchors
                                       (59, 119), (116, 90), (156, 198), (373, 326)],
                      "obj_threshold": 0.6,                                               # Threshold for object coverage, float value between 0 and 1
                      "nms_threshold": 0.5,                                               # Threshold for non-max suppression algorithm, float value between 0 and 1
                      "yolo_input_resolution": input_resolution_yolov3_HW}

Thanks.

Sir, What is that Assertion means and how to solve that assertion. I followed the github repository.

Hi,

For this tutorial, you can check the output dimension below:

Thanks.