Skip to content

Commit 6f83aad

Browse files
authored
fit to paddle2.1 (#995)
1 parent ff62d22 commit 6f83aad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paddleseg/models/layers/activation.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ def __init__(self, act=None):
5353
super(Activation, self).__init__()
5454

5555
self._act = act
56-
upper_act_names = nn.layer.activation.__all__
56+
upper_act_names = nn.layer.activation.__dict__.keys()
5757
lower_act_names = [act.lower() for act in upper_act_names]
5858
act_dict = dict(zip(lower_act_names, upper_act_names))
5959

6060
if act is not None:
6161
if act in act_dict.keys():
6262
act_name = act_dict[act]
63-
self.act_func = eval("nn.layer.activation.{}()".format(act_name))
63+
self.act_func = eval(
64+
"nn.layer.activation.{}()".format(act_name))
6465
else:
6566
raise KeyError("{} does not exist in the current {}".format(
6667
act, act_dict.keys()))

0 commit comments

Comments
 (0)