enazoe / yolo-tensorrt

TensorRT8.Support Yolov5n,s,m,l,x .darknet -> tensorrt. Yolov4 Yolov3 use raw darknet *.weights and *.cfg fils. If the wrapper is useful to you,please Star it.
MIT License
1.18k stars 316 forks source link

TensorRT 8 #148

Open auto-amc opened 2 years ago

auto-amc commented 2 years ago

Hi, Earlier, I tried to start my network on version TensorRT 7 and everything worked great when switching to the 8 version branch, the conversion to goes well, but the detection does not work correctly and the next error occurs the following error- "Assertion `get3DTensorVolume(m_Engine->getBindingDimensions(tensor.bindingIndex)) == tensor.volume && "Tensor volumes dont match between cfg and engine file \n"' failed" my config: Ubuntu 20.04 , Driver Version: 470.63.01,CUDA Version:release 11.3, V11.3.58 ,yolov4-tiny-3l.cfg from https://github.com/AlexeyAB/darknet

Thank you in advance for your reply.

auto-amc commented 2 years ago

ylov4 work fine,problem with yolov4-tiny

Nuzhny007 commented 2 years ago

Tiny-yolo for TensorRT 8 (TRT8 branch) now do not works. The reason of your error is here: https://github.com/enazoe/yolo-tensorrt/blob/TRT8/modules/yolo.cpp#L1163

            if (m_NetworkType == "yolov4")//pan
            {
                outputTensor.gridSize = (m_InputH / 32) * pow(2, 2-_n_yolo_ind);
                outputTensor.grid_h = (m_InputH / 32) * pow(2, 2-_n_yolo_ind);
                outputTensor.grid_w = (m_InputW / 32) * pow(2, 2-_n_yolo_ind);
            }

This code runs for yolov4-tiny but it is wrong! In TRT8 branch type "yolov4-tiny" was removed. It need to return it.

@enazoe what do you think about it?

enazoe commented 2 years ago

@Nuzhny007 @auto-amc sry, some trt api is removed in TRT8 ,so tiny model is not support now .

Nuzhny007 commented 2 years ago

@enazoe actually no. I'm merged your master and TRT8 branches and yolov4-tiny works both on TensorRT 7 and TensorRT 8: https://github.com/Smorodov/Multitarget-tracker/tree/master/src/Detector/tensorrt_yolo If you want then I create a big pull request with all my changes. Or you can download sources from Multitarget-tracker repository and take some changes only for yolov4-tiny.

auto-amc commented 2 years ago

Спасибо большое!Вы делаете очень большую и нужную работуСкачаю и проверюА как насчет yolov4-tiny_contrastive?Вы не обучали ?Если да очень интересно было бы посмотреть результатС уважениемВладимир 23.11.2021, 11:00, "Sergey Nuzhny" @.**@. actually no. I'm merged your master and TRT8 branches and yolov4-tiny works both on TensorRT 7 and TensorRT 8: https://github.com/Smorodov/Multitarget-tracker/tree/master/src/Detector/tensorrt_yoloIf you want then I create a big pull request with all my changes. Or you can download sources from Multitarget-tracker repository and take some changes only for yolov4-tiny.—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

Nuzhny007 commented 2 years ago

Here: https://github.com/enazoe/yolo-tensorrt/pull/158 I don't sure that all changes will be useful for your repository. I'm using this module in my tracker on Windows/Ubuntu x86 and Jetson NX.

@auto-amc I don't know about yolov4-tiny_contrastive. Never used it