-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YOLOv3-tiny、YOLOv4可以转,YOLOv4-tiny转不了 #31
Comments
@doolisty are you solve this problem? |
hi, did you guys solve this problem? thanks |
yolo4有mish应该转不了caffe吧,v4tiny可以转 |
Chen has provided the 'mish' layer for caffe, just remake the caffe with new source and convert yolov4! about the yolov4-tiny, 'groups' and 'group_id' not available yet |
'groups'可以用caffe的slice实现 |
'groups'可以用caffe的slice实现,参考https://blog.csdn.net/qq_37532213/article/details/114642626。具体可以修改darknet2caffe.py里边的函数cfg2prototxt(cfgfile),将下边的内容粘贴覆盖进去就行。
|
anchor: 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 |
看错误提示,是不是读取config的时候参数读太多了,到后面加载的.weight文件里面的参数量不够分配的
还没时间详细找原因,希望作者review下代码
顺便贴一下错误日志,其中包含我的调试信息(我的是重新训练的单类检测):
layer1-conv
start: 128, conv_weight.size: 864, conv_weight.shape: (32, 3, 3, 3), conv_param[0].data[...]: (32, 3, 3, 3), buf[start:start+conv_weight.size]: (864,), buf: (5880324,)
layer2-conv
start: 1248, conv_weight.size: 18432, conv_weight.shape: (64, 32, 3, 3), conv_param[0].data[...]: (64, 32, 3, 3), buf[start:start+conv_weight.size]: (18432,), buf: (5880324,)
layer3-conv
start: 19936, conv_weight.size: 36864, conv_weight.shape: (64, 64, 3, 3), conv_param[0].data[...]: (64, 64, 3, 3), buf[start:start+conv_weight.size]: (36864,), buf: (5880324,)
layer5-conv
start: 56928, conv_weight.size: 18432, conv_weight.shape: (32, 64, 3, 3), conv_param[0].data[...]: (32, 64, 3, 3), buf[start:start+conv_weight.size]: (18432,), buf: (5880324,)
layer6-conv
start: 75488, conv_weight.size: 9216, conv_weight.shape: (32, 32, 3, 3), conv_param[0].data[...]: (32, 32, 3, 3), buf[start:start+conv_weight.size]: (9216,), buf: (5880324,)
layer8-conv
start: 84960, conv_weight.size: 4096, conv_weight.shape: (64, 64, 1, 1), conv_param[0].data[...]: (64, 64, 1, 1), buf[start:start+conv_weight.size]: (4096,), buf: (5880324,)
layer11-conv
start: 89568, conv_weight.size: 147456, conv_weight.shape: (128, 128, 3, 3), conv_param[0].data[...]: (128, 128, 3, 3), buf[start:start+conv_weight.size]: (147456,), buf: (5880324,)
layer13-conv
start: 237280, conv_weight.size: 73728, conv_weight.shape: (64, 128, 3, 3), conv_param[0].data[...]: (64, 128, 3, 3), buf[start:start+conv_weight.size]: (73728,), buf: (5880324,)
layer14-conv
start: 311264, conv_weight.size: 36864, conv_weight.shape: (64, 64, 3, 3), conv_param[0].data[...]: (64, 64, 3, 3), buf[start:start+conv_weight.size]: (36864,), buf: (5880324,)
layer16-conv
start: 348640, conv_weight.size: 16384, conv_weight.shape: (128, 128, 1, 1), conv_param[0].data[...]: (128, 128, 1, 1), buf[start:start+conv_weight.size]: (16384,), buf: (5880324,)
layer19-conv
start: 366048, conv_weight.size: 589824, conv_weight.shape: (256, 256, 3, 3), conv_param[0].data[...]: (256, 256, 3, 3), buf[start:start+conv_weight.size]: (589824,), buf: (5880324,)
layer21-conv
start: 956384, conv_weight.size: 294912, conv_weight.shape: (128, 256, 3, 3), conv_param[0].data[...]: (128, 256, 3, 3), buf[start:start+conv_weight.size]: (294912,), buf: (5880324,)
layer22-conv
start: 1251808, conv_weight.size: 147456, conv_weight.shape: (128, 128, 3, 3), conv_param[0].data[...]: (128, 128, 3, 3), buf[start:start+conv_weight.size]: (147456,), buf: (5880324,)
layer24-conv
start: 1400288, conv_weight.size: 65536, conv_weight.shape: (256, 256, 1, 1), conv_param[0].data[...]: (256, 256, 1, 1), buf[start:start+conv_weight.size]: (65536,), buf: (5880324,)
layer27-conv
start: 1467872, conv_weight.size: 2359296, conv_weight.shape: (512, 512, 3, 3), conv_param[0].data[...]: (512, 512, 3, 3), buf[start:start+conv_weight.size]: (2359296,), buf: (5880324,)
layer28-conv
start: 3828192, conv_weight.size: 131072, conv_weight.shape: (256, 512, 1, 1), conv_param[0].data[...]: (256, 512, 1, 1), buf[start:start+conv_weight.size]: (131072,), buf: (5880324,)
layer29-conv
start: 3961312, conv_weight.size: 1179648, conv_weight.shape: (512, 256, 3, 3), conv_param[0].data[...]: (512, 256, 3, 3), buf[start:start+conv_weight.size]: (1179648,), buf: (5880324,)
unknow layer type yolo
layer33-conv
start: 5150706, conv_weight.size: 32768, conv_weight.shape: (128, 256, 1, 1), conv_param[0].data[...]: (128, 256, 1, 1), buf[start:start+conv_weight.size]: (32768,), buf: (5880324,)
layer36-conv
start: 5184498, conv_weight.size: 884736, conv_weight.shape: (256, 384, 3, 3), conv_param[0].data[...]: (256, 384, 3, 3), buf[start:start+conv_weight.size]: (695826,), buf: (5880324,)
Traceback (most recent call last):
File "darknet2caffe.py", line 534, in
darknet2caffe(cfgfile, weightfile, protofile, caffemodel)
File "darknet2caffe.py", line 69, in darknet2caffe
start = load_conv_bn2caffe(buf, start, params[conv_layer_name], params[bn_layer_name], params[scale_layer_name])
File "darknet2caffe.py", line 164, in load_conv_bn2caffe
conv_param[0].data[...] = np.reshape(buf[start:start+conv_weight.size], conv_weight.shape); start = start + conv_weight.size
File "/home/**/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 292, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "/home/**/.local/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 695826 into shape (256,384,3,3)
The text was updated successfully, but these errors were encountered: