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.19k
stars
315
forks
source link
Did anyone have done inference with custom anchors? #116
Hi guys, I'm using YOLOv5 3.0 and I've trained a yolov5L model generating 7 anchors for my custom dataset composed by 3x800x800 pixel images.
The autoanchors function returns the array of generated anchors that I put in my yaml file, and they look like this:
Now I would like to use those anchors in this c++ solution, but for now I didn't have any success.
I keep getting this error:
File does not exist : ../configs/yolov5-3.0/yolov5l_custom-kFLOAT-batch1.engine
Loading pre-trained weights...
Loading complete!
layer inp_size out_size
(1) Focus 3 x 800 x 800 64 x 400 x 400
(2) Conv 64 x 400 x 400 128 x 200 x 200
(3) BottleneckCSP 128 x 200 x 200 128 x 200 x 200
(4) Conv 128 x 200 x 200 256 x 100 x 100
(5) BottleneckCSP 256 x 100 x 100 256 x 100 x 100
(6) Conv 256 x 100 x 100 512 x 50 x 50
(7) BottleneckCSP 512 x 50 x 50 512 x 50 x 50
(8) Conv 512 x 50 x 50 1024 x 25 x 25
(9) SPP 1024 x 25 x 25 1024 x 25 x 25
(10) BottleneckCSP 1024 x 25 x 25 1024 x 25 x 25
(11) Conv 1024 x 25 x 25 512 x 25 x 25
(12) Upsample 512 x 25 x 25 512 x 50 x 50
(13) Concat 512 x 50 x 50 1024 x 50 x 50
(14) BottleneckCSP 1024 x 50 x 50 512 x 50 x 50
(15) Conv 512 x 50 x 50 256 x 50 x 50
(16) Upsample 256 x 50 x 50 256 x 100 x 100
(17) Concat 256 x 100 x 100 512 x 100 x 100
(18) BottleneckCSP 512 x 100 x 100 256 x 100 x 100
(19) Conv 256 x 100 x 100 256 x 50 x 50
(20) Concat 256 x 50 x 50 512 x 50 x 50
(21) BottleneckCSP 512 x 50 x 50 512 x 50 x 50
(22) Conv 512 x 50 x 50 512 x 25 x 25
(23) Concat 512 x 25 x 25 1024 x 25 x 25
(24) BottleneckCSP 1024 x 25 x 25 1024 x 25 x 25
Assertion failed: size == (map_wts_[s_layer_name_ + ".weight"].size()), file .\yolo_tensorrt\modules\trt_utils.cpp, line 854
The layer that seems to not have the right size is
s_layer_name = "model.24.m.0" = 19712
and
int size = n_filters_ * chw[0] * n_kernel_size_ * n_kernel_size; = 8448
So for some reason size is exactly the half of s_layer_name.
Can someone help me out with this? I'm using TensorRT 7.1.3.4, OpenCV 4.4.0.
Thanks in advance!
Hi guys, I'm using YOLOv5 3.0 and I've trained a yolov5L model generating 7 anchors for my custom dataset composed by 3x800x800 pixel images. The autoanchors function returns the array of generated anchors that I put in my yaml file, and they look like this:
When I do some inference in Pytorch everything is ok.
Then I convert my model and the yaml to cfg file, and my cfg file look like this:
Now I would like to use those anchors in this c++ solution, but for now I didn't have any success. I keep getting this error:
The layer that seems to not have the right size is
s_layer_name = "model.24.m.0"
= 19712 andint size = n_filters_ * chw[0] * n_kernel_size_ * n_kernel_size;
= 8448 So for some reason size is exactly the half of s_layer_name.Can someone help me out with this? I'm using TensorRT 7.1.3.4, OpenCV 4.4.0. Thanks in advance!