From d9140ee95fda032ce462c3f53c3a5778c6d9c7ed Mon Sep 17 00:00:00 2001 From: SunAhong1993 Date: Mon, 23 Sep 2019 17:50:32 +0800 Subject: [PATCH] fix the lrn --- x2paddle/op_mapper/caffe_op_mapper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x2paddle/op_mapper/caffe_op_mapper.py b/x2paddle/op_mapper/caffe_op_mapper.py index aa536bc..8c0040d 100644 --- a/x2paddle/op_mapper/caffe_op_mapper.py +++ b/x2paddle/op_mapper/caffe_op_mapper.py @@ -652,6 +652,7 @@ class CaffeOpMapper(OpMapper): ]).astype('float32') scale = 0 else: + node.data = [np.squeeze(i).astype('float32') for i in node.data] mean, variance, scale = node.data # Prescale the stats @@ -687,8 +688,10 @@ class CaffeOpMapper(OpMapper): input_c, ]).astype('float32') else: - self.weights[node.layer_name + '_scale'] = np.squeeze(node.data[0]).astype('float32') - self.weights[node.layer_name + '_offset'] = np.squeeze(node.data[1]).astype('float32') + self.weights[node.layer_name + '_scale'] = np.squeeze( + node.data[0]).astype('float32') + self.weights[node.layer_name + '_offset'] = np.squeeze( + node.data[1]).astype('float32') params = node.layer.scale_param axis = params.axis num_axes = params.num_axes -- GitLab