onnx2caffe icon indicating copy to clipboard operation
onnx2caffe copied to clipboard

KeyError: u'broadcast' when convert onnx to caffe for resnet18

Open xmuszq opened this issue 6 years ago • 7 comments

the resnet18 in onnx is converted from mxnet. I want to convert this r18 in onnx to caffe. the error is listed below. Anything I can do to remove this error?

Traceback (most recent call last): File "convertCaffe.py", line 108, in convertToCaffe(graph, prototxt_path, caffemodel_path) File "convertCaffe.py", line 55, in convertToCaffe layer = converter_fn(node,graph,err) File "/home/zhen/Downloads/onnx2caffe/onnx2caffe/_operators.py", line 255, in _convert_gemm if node.attrs["broadcast"] != 1 or node.attrs["transB"] != 1: KeyError: u'broadcast'

xmuszq avatar Jun 06 '19 20:06 xmuszq

the same error!

cccober avatar Jul 26 '19 07:07 cccober

the same error! I just remove that line, it works...

Hansoluo avatar Sep 16 '19 13:09 Hansoluo

In reference to url: https://github.com/onnx/onnx-tensorrt/issues/24, broadcast checking for opset ver > 7 should be removed.

crouchggj avatar May 02 '20 07:05 crouchggj

the same error! I just remove that line, it works...

And you get a correct caffe model ?

shopping-tang avatar Jun 03 '20 07:06 shopping-tang

Hi,i meet the same error,how did you solve this ? @shopping-tang @Hansoluo This url means to modify th onnx source code? @crouchggj

xiexu666 avatar Jul 23 '20 02:07 xiexu666

Hi,i meet the same error,how did you solve this ? @shopping-tang @Hansoluo This url means to modify th onnx source code? @crouchggj

emmm, it's been a while, I've forgotten.Sorry..... https://github.com/MTlab/onnx2caffe/issues/34, maybe you can take a look at this link.Hope it works for you.

shopping-tang avatar Jul 23 '20 03:07 shopping-tang

Hi,i meet the same error,how did you solve this ? @shopping-tang @Hansoluo This url means to modify th onnx source code? @crouchggj

emmm, it's been a while, I've forgotten.Sorry..... #34, maybe you can take a look at this link.Hope it works for you. Thank for your reply.

xiexu666 avatar Jul 26 '20 15:07 xiexu666