BingzheWu / object_detetction_tools

43 stars 11 forks source link

Support for yolov3-tiny #2

Open timlueg opened 6 years ago

timlueg commented 6 years ago

Converting yolov3-tiny model with darknet2caffe.py results in the following error.

I0910 16:34:02.984822 21620 net.cpp:86] Creating Layer layer21-route I0910 16:34:02.984827 21620 net.cpp:408] layer21-route <- layer20-upsample I0910 16:34:02.984830 21620 net.cpp:408] layer21-route <- layer9-conv_layer9-act_0_split_1 I0910 16:34:02.984835 21620 net.cpp:382] layer21-route -> layer21-route F0910 16:34:02.984851 21620 concat_layer.cpp:42] Check failed: top_shape[j] == bottom[i]->shape(j) (24 vs. 26) All inputs must have the same shape, except at concat_axis. Check failure stack trace: Aborted (core dumped)

yolov3-tiny.cfg.txt full_log.txt

BingzheWu commented 6 years ago

I also found this problem. This is caused by the difference of the Max-Pooling Layer in Caffe and Draknet. The darknet will set the pad = 1 in the Max-Pooling layer when you did not give a pad value.

timlueg commented 6 years ago

I tried adding pad = 1 to all maxpool layers in yolov3-tiny.cfg file as well as modifying the darknet2caffe script to generate the padding for the .prototxt file but there is still a shape mismatch.

yolov3_gen.prototext.txt

comeonwmz commented 5 years ago

I think this problem happens because the padding mode in caffe don't support SAME. The last maxpool has an input size of 13x13, filter size is 2, stride is 1. So it has an output size of 12x12 without SAME mode as 13 is odd. I wonder how to solve this in caffe @BingzheWu

chenyuqing commented 5 years ago

So did you guys have had an solution for this now ? I run to the same issue now.

chenyuqing commented 5 years ago

@BingzheWu @comeonwmz

comeonwmz commented 5 years ago

You can try adjusting the filter size of the maxpool to make it pass. e.g. size is 3 &pad is 1, or size is 1 while pad is 0. I don't know if there is any other way to solve the problem @chenyuqing