From 7eb6a2b176cb5abab39b15faab6054332ceff807 Mon Sep 17 00:00:00 2001 From: conansherry Date: Wed, 18 Jul 2018 17:14:35 +0800 Subject: [PATCH] fix caffe model converted when group == 1, is_depthwise is False. --- mace/python/tools/converter_tool/caffe_converter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mace/python/tools/converter_tool/caffe_converter.py b/mace/python/tools/converter_tool/caffe_converter.py index ef5ba0ad..840f5dd3 100644 --- a/mace/python/tools/converter_tool/caffe_converter.py +++ b/mace/python/tools/converter_tool/caffe_converter.py @@ -355,7 +355,7 @@ class CaffeConverter(base_converter.ConverterInterface): op = self.convert_general_op(caffe_op) param = caffe_op.layer.convolution_param is_depthwise = False - if param.HasField(caffe_group_str): + if param.HasField(caffe_group_str) and param.group > 1: filter_data = caffe_op.blobs[0] mace_check(param.group == filter_data.shape[0] and filter_data.shape[1] == 1, @@ -403,7 +403,7 @@ class CaffeConverter(base_converter.ConverterInterface): op = self.convert_general_op(caffe_op) param = caffe_op.layer.convolution_param is_depthwise = False - if param.HasField(caffe_group_str): + if param.HasField(caffe_group_str) and param.group > 1: filter_data = caffe_op.blobs[0] mace_check(param.group == filter_data.shape[0] and filter_data.shape[1] == 1, -- GitLab