提交 49bf3d3f 编写于 作者: littletomatodonkey's avatar littletomatodonkey

add resnest metrics

上级 911611d9
......@@ -286,8 +286,8 @@ ResNeSt与RegNet系列模型的精度、速度指标如下表所示,更多关
| 模型 | Top-1 Acc | Top-5 Acc | time(ms)<br>bs=1 | time(ms)<br>bs=4 | Flops(G) | Params(M) | 下载地址 |
|------------------------|-----------|-----------|------------------|------------------|----------|-----------|------------------------------------------------------------------------------------------------------|
| ResNeSt50_<br>fast_1s1x64d | 0.8035 | 0.9528 | - | - | 8.68 | 26.3 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_fast_1s1x64d_pretrained.pdparams) |
| ResNeSt50 | 0.8102 | 0.9542 | - | - | 10.78 | 27.5 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_pretrained.pdparams) |
| ResNeSt50_<br>fast_1s1x64d | 0.8035 | 0.9528 | 3.45405 | 8.72680 | 8.68 | 26.3 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_fast_1s1x64d_pretrained.pdparams) |
| ResNeSt50 | 0.8102 | 0.9542 | 6.69042 | 8.01664 | 10.78 | 27.5 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_pretrained.pdparams) |
| RegNetX_4GF | 0.785 | 0.9416 | 6.46478 | 11.19862 | 8 | 22.1 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/RegNetX_4GF_pretrained.pdparams) |
......
......@@ -17,6 +17,6 @@ RegNet was proposed in 2020 by Facebook to deepen the concept of design space. B
| Models | Crop Size | Resize Short Size | FP16<br>Batch Size=1<br>(ms) | FP16<br>Batch Size=4<br>(ms) | FP16<br>Batch Size=8<br>(ms) | FP32<br>Batch Size=1<br>(ms) | FP32<br>Batch Size=4<br>(ms) | FP32<br>Batch Size=8<br>(ms) |
|--------------------|-----------|-------------------|------------------------------|------------------------------|------------------------------|------------------------------|------------------------------|------------------------------|
| ResNeSt50_fast_1s1x64d | 224 | 256 | - | - | - | - | - | - |
| ResNeSt50 | 224 | 256 | - | - | - | - | - | - |
| ResNeSt50_fast_1s1x64d | 224 | 256 | 3.46466 | 5.56647 | 9.11848 | 3.45405 | 8.72680 | 15.48710 |
| ResNeSt50 | 224 | 256 | 7.05851 | 8.97676 | 13.34704 | 6.16248 | 12.0633 | 21.49936 |
| RegNetX_4GF | 224 | 256 | 6.69042 | 8.01664 | 11.60608 | 6.46478 | 11.19862 | 16.89089 |
......@@ -20,6 +20,6 @@ RegNet是由facebook于2020年提出,旨在深化设计空间理念的概念
| Models | Crop Size | Resize Short Size | FP16<br>Batch Size=1<br>(ms) | FP16<br>Batch Size=4<br>(ms) | FP16<br>Batch Size=8<br>(ms) | FP32<br>Batch Size=1<br>(ms) | FP32<br>Batch Size=4<br>(ms) | FP32<br>Batch Size=8<br>(ms) |
|--------------------|-----------|-------------------|------------------------------|------------------------------|------------------------------|------------------------------|------------------------------|------------------------------|
| ResNeSt50_fast_1s1x64d | 224 | 256 | - | - | - | - | - | - |
| ResNeSt50 | 224 | 256 | - | - | - | - | - | - |
| ResNeSt50_fast_1s1x64d | 224 | 256 | 3.46466 | 5.56647 | 9.11848 | 3.45405 | 8.72680 | 15.48710 |
| ResNeSt50 | 224 | 256 | 7.05851 | 8.97676 | 13.34704 | 6.16248 | 12.0633 | 21.49936 |
| RegNetX_4GF | 224 | 256 | 6.69042 | 8.01664 | 11.60608 | 6.46478 | 11.19862 | 16.89089 |
......@@ -104,11 +104,7 @@ class ResNeSt():
is_first=False,
name="layer1")
x = self.resnest_layer(
x=x,
planes=128,
blocks=self.layers[1],
stride=2,
name="layer2")
x=x, planes=128, blocks=self.layers[1], stride=2, name="layer2")
if self.dilated or self.dilation == 4:
x = self.resnest_layer(
x=x,
......@@ -152,10 +148,8 @@ class ResNeSt():
blocks=self.layers[3],
stride=2,
name="layer4")
x = fluid.layers.pool2d(
input=x, pool_type="avg", global_pooling=True)
x = fluid.layers.dropout(
x=x, dropout_prob=self.final_drop)
x = fluid.layers.pool2d(input=x, pool_type="avg", global_pooling=True)
x = fluid.layers.dropout(x=x, dropout_prob=self.final_drop)
stdv = 1.0 / math.sqrt(x.shape[1] * 1.0)
x = fluid.layers.fc(
input=x,
......@@ -266,8 +260,7 @@ class ResNeSt():
param_attr=ParamAttr(
name=name + "_splat_weights", initializer=MSRA()),
bias_attr=False)
atten = self.rsoftmax(
x=atten, radix=radix, cardinality=groups)
atten = self.rsoftmax(x=atten, radix=radix, cardinality=groups)
atten = fluid.layers.reshape(x=atten, shape=[-1, atten.shape[1], 1, 1])
if radix > 1:
......@@ -275,10 +268,10 @@ class ResNeSt():
input=atten, num_or_sections=radix, dim=1)
out = fluid.layers.sum([
fluid.layers.elementwise_mul(
x=att, y=split) for (att, split) in zip(attens, splited)
x=split, y=att) for (att, split) in zip(attens, splited)
])
else:
out = fluid.layers.elementwise_mul(atten, x)
out = fluid.layers.elementwise_mul(x, atten)
return out
def bottleneck(self,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册