×

签到

分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

yolov4-tiny转caffe模型失败 已解决 cxgk2022-09-23 15:08:59 回复 5 查看 技术答疑 使用求助
yolov4-tiny转caffe模型失败
分享到:

【寒武纪硬件产品型号】必填*:MLU270

【使用操作系统】必填*:ubuntu18.04

【使用AI框架】必填*:Cambricon Caffe

Docker 镜像的环境:

·      Ubuntu 18.04

·      Cambricon Caffe (对应原生 Caffe v5.2.0)

你好,使用docker中的darknet2caffe.py转yolov4-tiny(https://github.com/AlexeyAB/darknet)官方模型失败

日志如下:

I0923 14:43:55.676295   170 net.cpp:2106] top 0 shape: 1 384 26 26 (259584)
I0923 14:43:55.676301   170 net.cpp:2102] name: 36-conv
I0923 14:43:55.676303   170 net.cpp:2104] bottom 0 shape: 1 384 26 26 (259584)
I0923 14:43:55.676307   170 net.cpp:2106] top 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676312   170 net.cpp:2102] name: 36-bn
I0923 14:43:55.676317   170 net.cpp:2104] bottom 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676321   170 net.cpp:2106] top 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676326   170 net.cpp:2102] name: 36-scale
I0923 14:43:55.676329   170 net.cpp:2104] bottom 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676332   170 net.cpp:2106] top 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676337   170 net.cpp:2102] name: 36-act
I0923 14:43:55.676340   170 net.cpp:2104] bottom 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676344   170 net.cpp:2106] top 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676348   170 net.cpp:2102] name: 37-conv
I0923 14:43:55.676352   170 net.cpp:2104] bottom 0 shape: 1 256 26 26 (173056)
I0923 14:43:55.676355   170 net.cpp:2106] top 0 shape: 1 255 26 26 (172380)
unknow type yolo
Traceback (most recent call last):
  File "darknet2caffe.py", line 514, in <module>
    darknet2caffe(cfgfile, weightfile, protofile, caffemodel)
  File "darknet2caffe.py", line 56, in darknet2caffe
    start = load_conv_bn2caffe(buf, start, params[conv_ _name], params[bn_ _name], params[scale_ _name])
  File "darknet2caffe.py", line 143, 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 "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 292, in reshape
    return _wrapfunc(a, 'reshape', newshape, order=order)
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
    return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 756735 into shape (256,384,3,3)


请问如何解决?谢谢!



版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭