lewes6369 / TensorRT-Yolov3

TensorRT for Yolov3
MIT License
489 stars 165 forks source link

Anyone is using input size other than 416*416 and 618*618? My network is 576*352 and my prediction is messed up #46

Closed zeyuDai2018 closed 5 years ago

zeyuDai2018 commented 5 years ago

I think I didn't miss anything, here's what I did: 1>Use the darknet2caffe converter to convert my yolov3 from darknet to caffe. No errors occured. 2>Add output layers in the last lines in the prototxt file. 3>Modify the Yoloconfigs.h file change the class number and the kernel size and anchor. 4>Change the INPUT_WIDTH and INPUT_HEIGHT and relevant parameters in TensorRT- Yolov3/include/configs.h. 5>Use the code given to serialize the engine, and detect the picture with width 576 height 352 no error shown in the command line. I've tried the model in darknet it works fine but when I want to use the tensorrt engine generated it seems the predictions are random. I've checked the PostProcessImg in the main file the decoding part and I don't think the different size of width and height would effect the decoding part. However, by printing out the output of the network it seems the mid point is never the real mid point of the target. Anyone seeing this kind of problem? Or any information about this non-square input size would work or not?

sashasava commented 4 years ago

I think I didn't miss anything, here's what I did: 1>Use the darknet2caffe converter to convert my yolov3 from darknet to caffe. No errors occured. 2>Add output layers in the last lines in the prototxt file. 3>Modify the Yoloconfigs.h file change the class number and the kernel size and anchor. 4>Change the INPUT_WIDTH and INPUT_HEIGHT and relevant parameters in TensorRT- Yolov3/include/configs.h. 5>Use the code given to serialize the engine, and detect the picture with width 576 height 352 no error shown in the command line. I've tried the model in darknet it works fine but when I want to use the tensorrt engine generated it seems the predictions are random. I've checked the PostProcessImg in the main file the decoding part and I don't think the different size of width and height would effect the decoding part. However, by printing out the output of the network it seems the mid point is never the real mid point of the target. Anyone seeing this kind of problem? Or any information about this non-square input size would work or not?

Have you solved this problem? Or this is TensorRT limitation?

zeyuDai2018 commented 4 years ago

I think I didn't miss anything, here's what I did: 1>Use the darknet2caffe converter to convert my yolov3 from darknet to caffe. No errors occured. 2>Add output layers in the last lines in the prototxt file. 3>Modify the Yoloconfigs.h file change the class number and the kernel size and anchor. 4>Change the INPUT_WIDTH and INPUT_HEIGHT and relevant parameters in TensorRT- Yolov3/include/configs.h. 5>Use the code given to serialize the engine, and detect the picture with width 576 height 352 no error shown in the command line. I've tried the model in darknet it works fine but when I want to use the tensorrt engine generated it seems the predictions are random. I've checked the PostProcessImg in the main file the decoding part and I don't think the different size of width and height would effect the decoding part. However, by printing out the output of the network it seems the mid point is never the real mid point of the target. Anyone seeing this kind of problem? Or any information about this non-square input size would work or not?

Have you solved this problem? Or this is TensorRT limitation

Hi : Yes I already solved it, this is not the limitation of TensorRT. These steps are correct as well. It's just a stupid mistake I made half year ago. Do forgive me as I really couldn't remember what that was.