diff --git a/x2paddle/op_mapper/caffe_op_mapper.py b/x2paddle/op_mapper/caffe_op_mapper.py index aa536bc44f27da40f4cdc6c21d25631a1dddf502..8c0040de4cd61ccecec5e5e2588e32abc641e1ec 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