未验证 提交 e82e1358 编写于 作者: G gaotingquan

BatchNorm -> BatchNorm2D

上级 925cb6ef
...@@ -18,7 +18,7 @@ import paddle ...@@ -18,7 +18,7 @@ import paddle
import paddle.nn as nn import paddle.nn as nn
import paddle.nn.functional as F import paddle.nn.functional as F
from paddle import ParamAttr from paddle import ParamAttr
from paddle.nn import AdaptiveAvgPool2D, BatchNorm, Conv2D, Dropout, Linear from paddle.nn import AdaptiveAvgPool2D, BatchNorm2D, Conv2D, Dropout, Linear
from paddle.regularizer import L2Decay from paddle.regularizer import L2Decay
from paddle.nn.initializer import KaimingNormal from paddle.nn.initializer import KaimingNormal
from ppcls.arch.backbone.base.theseus_layer import TheseusLayer from ppcls.arch.backbone.base.theseus_layer import TheseusLayer
...@@ -70,9 +70,9 @@ class ConvBNLayer(TheseusLayer): ...@@ -70,9 +70,9 @@ class ConvBNLayer(TheseusLayer):
weight_attr=ParamAttr(initializer=KaimingNormal()), weight_attr=ParamAttr(initializer=KaimingNormal()),
bias_attr=False) bias_attr=False)
self.bn = BatchNorm( self.bn = BatchNorm2D(
out_channels, out_channels,
param_attr=ParamAttr(regularizer=L2Decay(0.0)), weight_attr=ParamAttr(regularizer=L2Decay(0.0)),
bias_attr=ParamAttr(regularizer=L2Decay(0.0))) bias_attr=ParamAttr(regularizer=L2Decay(0.0)))
if self.use_act: if self.use_act:
self.act = nn.ReLU() self.act = nn.ReLU()
...@@ -393,4 +393,4 @@ def PPLCNetV2_base(pretrained=False, use_ssld=False, **kwargs): ...@@ -393,4 +393,4 @@ def PPLCNetV2_base(pretrained=False, use_ssld=False, **kwargs):
""" """
model = PPLCNetV2(scale=1.0, depths=[2, 2, 6, 2], **kwargs) model = PPLCNetV2(scale=1.0, depths=[2, 2, 6, 2], **kwargs)
_load_pretrained(pretrained, model, MODEL_URLS["PPLCNetV2_base"], use_ssld) _load_pretrained(pretrained, model, MODEL_URLS["PPLCNetV2_base"], use_ssld)
return model return model
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册