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

Fix some minor bugs to adapt to paddle2.0rc. (#431)

* Update mobilenet_v3.py

* Update densenet.py

* Update resnest.py

* Update hrnet.py

* Update vgg.py

* Update xception.py
上级 6796bca1
......@@ -278,7 +278,7 @@ class DenseNet(nn.Layer):
conv = self.batch_norm(conv)
y = self.pool2d_avg(conv)
y = paddle.reshape(y, shape=[0, -1])
y = paddle.reshape(y, shape=[-1, y.shape[1]])
y = self.out(y)
return y
......
......@@ -657,7 +657,7 @@ class HRNet(nn.Layer):
y = self.conv_last(y)
y = self.pool2d_avg(y)
y = paddle.reshape(y, shape=[0, -1])
y = paddle.reshape(y, shape=[-1, y.shape[1]])
y = self.out(y)
return y
......
......@@ -306,7 +306,7 @@ class SEModule(nn.Layer):
outputs = F.relu(outputs)
outputs = self.conv2(outputs)
outputs = hard_sigmoid(outputs)
return paddle.multiply(x=inputs, y=outputs, axis=0)
return paddle.multiply(x=inputs, y=outputs)
def MobileNetV3_small_x0_35(**args):
......
......@@ -85,11 +85,11 @@ class rSoftmax(nn.Layer):
x = paddle.reshape(
x=x,
shape=[
0, cardinality, radix, int(r * h * w / cardinality / radix)
batch, cardinality, radix, int(r * h * w / cardinality / radix)
])
x = paddle.transpose(x=x, perm=[0, 2, 1, 3])
x = nn.functional.softmax(x, axis=1)
x = paddle.reshape(x=x, shape=[0, r * h * w])
x = paddle.reshape(x=x, shape=[batch, r * h * w])
else:
x = nn.functional.sigmoid(x)
return x
......
......@@ -113,7 +113,7 @@ class VGGNet(nn.Layer):
x = self._conv_block_4(x)
x = self._conv_block_5(x)
x = paddle.reshape(x, [0, -1])
x = paddle.reshape(x, [-1, x.shape[1]*x.shape[2]*x.shape[3]])
x = self._fc1(x)
x = F.relu(x)
x = self._drop(x)
......
......@@ -305,7 +305,7 @@ class ExitFlow(nn.Layer):
conv2 = self._conv_2(conv1)
conv2 = F.relu(conv2)
pool = self._pool(conv2)
pool = paddle.reshape(pool, [0, -1])
pool = paddle.reshape(pool, [-1, pool.shape[1]])
out = self._out(pool)
return out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册