未验证 提交 94ced0b9 编写于 作者: L LiuTuo 提交者: GitHub

Merge pull request #521 from gasgallo/master

Fix convert_crop Caffe
......@@ -553,13 +553,16 @@ class CaffeConverter(base_converter.ConverterInterface):
param = caffe_op.layer.crop_param
op.type = MaceOp.Crop.name
axis = param.axis
axis = 2
if param.HasField('axis'):
axis = param.axis
axis = 4 + axis if axis < 0 else axis
offset_value = -1 * np.ones(4, dtype=np.int32)
offset_len = len(param.offset)
if offset_len == 1:
if offset_len <= 1:
while axis < 4:
offset_value[axis] = param.offset[0]
offset_value[axis] = 0 if offset_len < 1 else param.offset[0]
axis += 1
else:
offset_value[axis:] = param.offset
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册