Skip to content

Commit 208e791

Browse files
committed
Missed one of the abalation model entrypoints, update README
1 parent 2f884a0 commit 208e791

File tree

3 files changed

+21
-38
lines changed

3 files changed

+21
-38
lines changed

README.md

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## What's New
44

5+
### May 12, 2020
6+
* Add ResNeSt models (code adapted from https://github.com/zhanghang1989/ResNeSt, paper https://arxiv.org/abs/2004.08955))
7+
58
### May 3, 2020
69
* Pruned EfficientNet B1, B2, and B3 (https://arxiv.org/abs/2002.08258) contributed by [Yonathan Aflalo](https://github.com/yoniaflalo)
710

@@ -70,41 +73,6 @@
7073
* Add RandAugment trained EfficientNet-B0 weight with 77.7 top-1. Trained by [Michael Klachko](https://github.com/michaelklachko) with this code and recent hparams (see Training section)
7174
* Add `avg_checkpoints.py` script for post training weight averaging and update all scripts with header docstrings and shebangs.
7275

73-
### Dec 30, 2019
74-
* Merge [Dushyant Mehta's](https://github.com/mehtadushy) PR for SelecSLS (Selective Short and Long Range Skip Connections) networks. Good GPU memory consumption and throughput. Original: https://github.com/mehtadushy/SelecSLS-Pytorch
75-
76-
### Dec 28, 2019
77-
* Add new model weights and training hparams (see Training Hparams section)
78-
* `efficientnet_b3` - 81.5 top-1, 95.7 top-5 at default res/crop, 81.9, 95.8 at 320x320 1.0 crop-pct
79-
* trained with RandAugment, ended up with an interesting but less than perfect result (see training section)
80-
* `seresnext26d_32x4d`- 77.6 top-1, 93.6 top-5
81-
* deep stem (32, 32, 64), avgpool downsample
82-
* stem/dowsample from bag-of-tricks paper
83-
* `seresnext26t_32x4d`- 78.0 top-1, 93.7 top-5
84-
* deep tiered stem (24, 48, 64), avgpool downsample (a modified 'D' variant)
85-
* stem sizing mods from Jeremy Howard and fastai devs discussing ResNet architecture experiments
86-
87-
### Dec 23, 2019
88-
* Add RandAugment trained MixNet-XL weights with 80.48 top-1.
89-
* `--dist-bn` argument added to train.py, will distribute BN stats between nodes after each train epoch, before eval
90-
91-
### Dec 4, 2019
92-
* Added weights from the first training from scratch of an EfficientNet (B2) with my new RandAugment implementation. Much better than my previous B2 and very close to the official AdvProp ones (80.4 top-1, 95.08 top-5).
93-
94-
### Nov 29, 2019
95-
* Brought EfficientNet and MobileNetV3 up to date with my https://github.com/rwightman/gen-efficientnet-pytorch code. Torchscript and ONNX export compat excluded.
96-
* AdvProp weights added
97-
* Official TF MobileNetv3 weights added
98-
* EfficientNet and MobileNetV3 hook based 'feature extraction' classes added. Will serve as basis for using models as backbones in obj detection/segmentation tasks. Lots more to be done here...
99-
* HRNet classification models and weights added from https://github.com/HRNet/HRNet-Image-Classification
100-
* Consistency in global pooling, `reset_classifer`, and `forward_features` across models
101-
* `forward_features` always returns unpooled feature maps now
102-
* Reasonable chance I broke something... let me know
103-
104-
### Nov 22, 2019
105-
* Add ImageNet training RandAugment implementation alongside AutoAugment. PyTorch Transform compatible format, using PIL. Currently training two EfficientNet models from scratch with promising results... will update.
106-
* `drop-connect` cmd line arg finally added to `train.py`, no need to hack model fns. Works for efficientnet/mobilenetv3 based models, ignored otherwise.
107-
10876
## Introduction
10977

11078
For each competition, personal, or freelance project involving images + Convolution Neural Networks, I build on top of an evolving collection of code and models. This repo contains a (somewhat) cleaned up and paired down iteration of that code. Hopefully it'll be of use to others.

timm/models/layers/split_attn.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ def forward(self, x):
6868
x_gap = x
6969
x_gap = F.adaptive_avg_pool2d(x_gap, 1)
7070
x_gap = self.fc1(x_gap)
71-
7271
if self.bn1 is not None:
7372
x_gap = self.bn1(x_gap)
7473
x_gap = self.act1(x_gap)
75-
7674
x_attn = self.fc2(x_gap)
77-
x_attn = self.rsoftmax(x_attn).view(B, -1, 1, 1)
7875

76+
x_attn = self.rsoftmax(x_attn).view(B, -1, 1, 1)
7977
if self.radix > 1:
8078
out = (x * x_attn.reshape((B, self.radix, RC // self.radix, 1, 1))).sum(dim=1)
8179
else:

timm/models/resnest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,25 @@ def resnest269e(pretrained=False, num_classes=1000, in_chans=3, **kwargs):
237237
return model
238238

239239

240+
@register_model
241+
def resnest50d_4s2x40d(pretrained=False, num_classes=1000, in_chans=3, **kwargs):
242+
"""ResNeSt-50 4s2x40d from https://github.com/zhanghang1989/ResNeSt/blob/master/ablation.md
243+
"""
244+
default_cfg = default_cfgs['resnest50d_4s2x40d']
245+
model = ResNet(
246+
ResNestBottleneck, [3, 4, 6, 3], num_classes=num_classes, in_chans=in_chans,
247+
stem_type='deep', stem_width=32, avg_down=True, base_width=40, cardinality=2,
248+
block_args=dict(radix=4, avd=True, avd_first=True), **kwargs)
249+
model.default_cfg = default_cfg
250+
if pretrained:
251+
load_pretrained(model, default_cfg, num_classes, in_chans)
252+
return model
253+
254+
240255
@register_model
241256
def resnest50d_1s4x24d(pretrained=False, num_classes=1000, in_chans=3, **kwargs):
257+
"""ResNeSt-50 1s4x24d from https://github.com/zhanghang1989/ResNeSt/blob/master/ablation.md
258+
"""
242259
default_cfg = default_cfgs['resnest50d_1s4x24d']
243260
model = ResNet(
244261
ResNestBottleneck, [3, 4, 6, 3], num_classes=num_classes, in_chans=in_chans,

0 commit comments

Comments
 (0)