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

add resnest metrics

上级 911611d9
...@@ -286,8 +286,8 @@ ResNeSt与RegNet系列模型的精度、速度指标如下表所示,更多关 ...@@ -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) | 下载地址 | | 模型 | 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_<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 | - | - | 10.78 | 27.5 | [下载链接](https://paddle-imagenet-models-name.bj.bcebos.com/ResNeSt50_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) | | 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 ...@@ -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) | | 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_fast_1s1x64d | 224 | 256 | 3.46466 | 5.56647 | 9.11848 | 3.45405 | 8.72680 | 15.48710 |
| ResNeSt50 | 224 | 256 | - | - | - | - | - | - | | 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 | | RegNetX_4GF | 224 | 256 | 6.69042 | 8.01664 | 11.60608 | 6.46478 | 11.19862 | 16.89089 |
...@@ -20,6 +20,6 @@ RegNet是由facebook于2020年提出,旨在深化设计空间理念的概念 ...@@ -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) | | 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_fast_1s1x64d | 224 | 256 | 3.46466 | 5.56647 | 9.11848 | 3.45405 | 8.72680 | 15.48710 |
| ResNeSt50 | 224 | 256 | - | - | - | - | - | - | | 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 | | RegNetX_4GF | 224 | 256 | 6.69042 | 8.01664 | 11.60608 | 6.46478 | 11.19862 | 16.89089 |
...@@ -104,11 +104,7 @@ class ResNeSt(): ...@@ -104,11 +104,7 @@ class ResNeSt():
is_first=False, is_first=False,
name="layer1") name="layer1")
x = self.resnest_layer( x = self.resnest_layer(
x=x, x=x, planes=128, blocks=self.layers[1], stride=2, name="layer2")
planes=128,
blocks=self.layers[1],
stride=2,
name="layer2")
if self.dilated or self.dilation == 4: if self.dilated or self.dilation == 4:
x = self.resnest_layer( x = self.resnest_layer(
x=x, x=x,
...@@ -152,10 +148,8 @@ class ResNeSt(): ...@@ -152,10 +148,8 @@ class ResNeSt():
blocks=self.layers[3], blocks=self.layers[3],
stride=2, stride=2,
name="layer4") name="layer4")
x = fluid.layers.pool2d( x = fluid.layers.pool2d(input=x, pool_type="avg", global_pooling=True)
input=x, pool_type="avg", global_pooling=True) x = fluid.layers.dropout(x=x, dropout_prob=self.final_drop)
x = fluid.layers.dropout(
x=x, dropout_prob=self.final_drop)
stdv = 1.0 / math.sqrt(x.shape[1] * 1.0) stdv = 1.0 / math.sqrt(x.shape[1] * 1.0)
x = fluid.layers.fc( x = fluid.layers.fc(
input=x, input=x,
...@@ -266,8 +260,7 @@ class ResNeSt(): ...@@ -266,8 +260,7 @@ class ResNeSt():
param_attr=ParamAttr( param_attr=ParamAttr(
name=name + "_splat_weights", initializer=MSRA()), name=name + "_splat_weights", initializer=MSRA()),
bias_attr=False) bias_attr=False)
atten = self.rsoftmax( atten = self.rsoftmax(x=atten, radix=radix, cardinality=groups)
x=atten, radix=radix, cardinality=groups)
atten = fluid.layers.reshape(x=atten, shape=[-1, atten.shape[1], 1, 1]) atten = fluid.layers.reshape(x=atten, shape=[-1, atten.shape[1], 1, 1])
if radix > 1: if radix > 1:
...@@ -275,10 +268,10 @@ class ResNeSt(): ...@@ -275,10 +268,10 @@ class ResNeSt():
input=atten, num_or_sections=radix, dim=1) input=atten, num_or_sections=radix, dim=1)
out = fluid.layers.sum([ out = fluid.layers.sum([
fluid.layers.elementwise_mul( 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: else:
out = fluid.layers.elementwise_mul(atten, x) out = fluid.layers.elementwise_mul(x, atten)
return out return out
def bottleneck(self, def bottleneck(self,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册