From 32aa07a9fcac6de561ae59dac4c68a5960ee9a30 Mon Sep 17 00:00:00 2001 From: wjj19950828 Date: Mon, 6 Jun 2022 19:53:16 +0800 Subject: [PATCH] fixed for ci --- .../op_mapper/caffe2paddle/caffe_custom_layer/normalize.py | 2 +- x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py b/x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py index db22d14..184df4c 100644 --- a/x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py +++ b/x2paddle/op_mapper/caffe2paddle/caffe_custom_layer/normalize.py @@ -20,7 +20,7 @@ class Normalize(object): self.axis = axis def __call__(self, x, param): - l2_norm = paddle.norm(x=x, p=2, axis=1) + l2_norm = paddle.norm(x=x, p=2, axis=1, keepdim=True) param = paddle.reshape(param, [param.shape[-1]]) perm = list(range(len(l2_norm.shape))) perm.pop(self.axis) diff --git a/x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py b/x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py index a9a9794..8037308 100644 --- a/x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py +++ b/x2paddle/op_mapper/caffe2paddle/caffe_op_mapper.py @@ -429,10 +429,10 @@ class CaffeOpMapper(): assert params.local_size % 2 == 1 alpha = params.alpha / float(params.local_size) layer_attrs = { - "n": params.local_size, - "k": params.k, + "size": params.local_size, "alpha": alpha, "beta": params.beta, + "k": params.k, } self.paddle_graph.add_layer( "paddle.nn.LocalResponseNorm", -- GitLab