Wulingtian / yolov5_onnx2caffe

yolov5 onnx caffe
113 stars 37 forks source link

Errors happened when transforming onnx to caffe #12

Open larryKra opened 3 years ago

larryKra commented 3 years ago

Hi guys, thank u for ur code. But when I transformed onnx to caffe, I meet the error as following: Traceback (most recent call last): File "convertCaffe.py", line 160, in convertToCaffe(graph, prototxt_path, caffemodel_path, exis_focus=True, focus_concat_name="Concat_40", focus_conv_name="Conv_41") File "convertCaffe.py", line 98, in convertToCaffe layers[id] = layer._to_proto() # 转为 proto 风格? File "/home/workspace/yolov5_caffe/yolov5_onnx2caffe-master/MyCaffe.py", line 100, in _to_proto assign_proto(layer, k, v) File "/home/workspace/yolov5_caffe/yolov5_onnx2caffe-master/MyCaffe.py", line 29, in assign_proto is_repeated_field = hasattr(getattr(proto, name), 'extend') AttributeError: reorg_param

Do u have any ideas about that?

silllorc commented 3 years ago

Hi guys, thank u for ur code. But when I transformed onnx to caffe, I meet the error as following: Traceback (most recent call last): File "convertCaffe.py", line 160, in convertToCaffe(graph, prototxt_path, caffemodel_path, exis_focus=True, focus_concat_name="Concat_40", focus_conv_name="Conv_41") File "convertCaffe.py", line 98, in convertToCaffe layers[id] = layer._to_proto() # 转为 proto 风格? File "/home/workspace/yolov5_caffe/yolov5_onnx2caffe-master/MyCaffe.py", line 100, in _to_proto assign_proto(layer, k, v) File "/home/workspace/yolov5_caffe/yolov5_onnx2caffe-master/MyCaffe.py", line 29, in assign_proto is_repeated_field = hasattr(getattr(proto, name), 'extend') AttributeError: reorg_param

Hi,try to change like this vim covertCaffe.py Solved it by changing exis_focus=True to exis_focus=False

mozheng commented 3 years ago

我也有相似的问题,上采样不支持。是什么原因你知道吗? Traceback (most recent call last): File "convertCaffe.py", line 159, in convertToCaffe(graph, prototxt_path, caffemodel_path, exis_focus=False, focus_concat_name="Concat_40", focus_conv_name="Conv_41") File "convertCaffe.py", line 97, in convertToCaffe layers[id] = layer._to_proto() # 转为 proto 风格? File "/home/daxi/yolov5_onnx2caffe/MyCaffe.py", line 100, in _to_proto assign_proto(layer, k, v) File "/home/daxi/yolov5_onnx2caffe/MyCaffe.py", line 29, in assign_proto is_repeated_field = hasattr(getattr(proto, name), 'extend') AttributeError: upsample_param

silllorc commented 3 years ago

你可能没有在caffe编译环境里自定义添加upsample层。