未验证 提交 e6792d34 编写于 作者: C cuicheng01 提交者: GitHub

Update resnet.py

上级 90321ce3
...@@ -294,7 +294,7 @@ class ResNet(TheseusLayer): ...@@ -294,7 +294,7 @@ class ResNet(TheseusLayer):
self.avg_pool_channels = self.num_channels[-1] * 2 self.avg_pool_channels = self.num_channels[-1] * 2
stdv = 1.0 / math.sqrt(self.avg_pool_channels * 1.0) stdv = 1.0 / math.sqrt(self.avg_pool_channels * 1.0)
self.out = Linear( self.fc = Linear(
self.avg_pool_channels, self.avg_pool_channels,
self.class_num, self.class_num,
weight_attr=ParamAttr( weight_attr=ParamAttr(
...@@ -306,7 +306,7 @@ class ResNet(TheseusLayer): ...@@ -306,7 +306,7 @@ class ResNet(TheseusLayer):
x = self.blocks(x) x = self.blocks(x)
x = self.avg_pool(x) x = self.avg_pool(x)
x = paddle.reshape(x, shape=[-1, self.avg_pool_channels]) x = paddle.reshape(x, shape=[-1, self.avg_pool_channels])
x = self.out(x) x = self.fc(x)
return x return x
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册