Error occurs when converting yolov3's onnx file to trt file

I could convert yolov3’s self-learned weights file to onnx file using yolov3_to_onnx.py. However, the following error occurs when executing onnx_to_tensorrt.py.
ValueError: cannot reshape array of size 3456 into shape (1, 256, 8, 8)

The input_resolution_yolov3_HW on line 139 of onnx_to_tensorrt.py is set to (256,256). Also, output_shapes on line 148 is set to [(1, 256, 8, 8), (1, 256, 16, 16), (1, 256, 32, 32)]. How can I resolve the error?

Hi @kubo1,
Request you to share your model so that i can assist you better.
Thanks!

I cannot upload files. It may be because the capacity is large.(500MB)
The yolo weights file was trained with 256*256 images.

Hi @kubo1,
Can you try uploading it on drive and share the link here.
Thanks!

ok.
https://drive.google.com/file/d/1lk_Z3nIF-q5kOJueUlwRXJ0RDkZIXACu/view?usp=sharing

Hi @kubo1,
Your model worked fine for me.
Request you to try your model on latest TRT release with the below command
trtexec --onnx=yolo_1st.onnx --verbose --explicitBatch --shapes=000_net:64x3x256x256

Thanks!

Do I need to have anything installed to use the trtexec command? Or can I fix the error in onnx_to_tensorrt.py from the first question to see?

No, you need not to install anything additionally. It is packaged with TRT.
Please get more details from the link below.
https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/trtexec

Thanks!

I created a trt file from an onnx file. This.
https://drive.google.com/file/d/1gJzteuT4PEdskuUo9zeg6yLtpMXFj_WT/view?usp=sharing
I used the trt file instead of the weights file in yolo, which has customized my class, but nothing was found. Do I have to change anything besides the weights file?

Hi @kubo1,
Request you to check the below link for reference.

Thanks!