Skip to content

Commit e3c11a3

Browse files
committed
Start updating README and docs
1 parent b1f1a54 commit e3c11a3

File tree

9 files changed

+506
-579
lines changed

9 files changed

+506
-579
lines changed

README.md

Lines changed: 59 additions & 338 deletions
Large diffs are not rendered by default.

docs/archived_changes.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Archived Changes
2+
3+
### Feb 29, 2020
4+
* New MobileNet-V3 Large weights trained from stratch with this code to 75.77% top-1
5+
* IMPORTANT CHANGE - default weight init changed for all MobilenetV3 / EfficientNet / related models
6+
* overall results similar to a bit better training from scratch on a few smaller models tried
7+
* performance early in training seems consistently improved but less difference by end
8+
* set `fix_group_fanout=False` in `_init_weight_goog` fn if you need to reproducte past behaviour
9+
* Experimental LR noise feature added applies a random perturbation to LR each epoch in specified range of training
10+
11+
### Feb 18, 2020
12+
* Big refactor of model layers and addition of several attention mechanisms. Several additions motivated by 'Compounding the Performance Improvements...' (https://arxiv.org/abs/2001.06268):
13+
* Move layer/module impl into `layers` subfolder/module of `models` and organize in a more granular fashion
14+
* ResNet downsample paths now properly support dilation (output stride != 32) for avg_pool ('D' variant) and 3x3 (SENets) networks
15+
* Add Selective Kernel Nets on top of ResNet base, pretrained weights
16+
* skresnet18 - 73% top-1
17+
* skresnet34 - 76.9% top-1
18+
* skresnext50_32x4d (equiv to SKNet50) - 80.2% top-1
19+
* ECA and CECA (circular padding) attention layer contributed by [Chris Ha](https://github.com/VRandme)
20+
* CBAM attention experiment (not the best results so far, may remove)
21+
* Attention factory to allow dynamically selecting one of SE, ECA, CBAM in the `.se` position for all ResNets
22+
* Add DropBlock and DropPath (formerly DropConnect for EfficientNet/MobileNetv3) support to all ResNet variants
23+
* Full dataset results updated that incl NoisyStudent weights and 2 of the 3 SK weights
24+
25+
### Feb 12, 2020
26+
* Add EfficientNet-L2 and B0-B7 NoisyStudent weights ported from [Tensorflow TPU](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet)
27+
28+
### Feb 6, 2020
29+
* Add RandAugment trained EfficientNet-ES (EdgeTPU-Small) weights with 78.1 top-1. Trained by [Andrew Lavin](https://github.com/andravin) (see Training section for hparams)
30+
31+
### Feb 1/2, 2020
32+
* Port new EfficientNet-B8 (RandAugment) weights, these are different than the B8 AdvProp, different input normalization.
33+
* Update results csv files on all models for ImageNet validation and three other test sets
34+
* Push PyPi package update
35+
36+
### Jan 31, 2020
37+
* Update ResNet50 weights with a new 79.038 result from further JSD / AugMix experiments. Full command line for reproduction in training section below.
38+
39+
### Jan 11/12, 2020
40+
* Master may be a bit unstable wrt to training, these changes have been tested but not all combos
41+
* Implementations of AugMix added to existing RA and AA. Including numerous supporting pieces like JSD loss (Jensen-Shannon divergence + CE), and AugMixDataset
42+
* SplitBatchNorm adaptation layer added for implementing Auxiliary BN as per AdvProp paper
43+
* ResNet-50 AugMix trained model w/ 79% top-1 added
44+
* `seresnext26tn_32x4d` - 77.99 top-1, 93.75 top-5 added to tiered experiment, higher img/s than 't' and 'd'
45+
46+
### Jan 3, 2020
47+
* 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)
48+
* Add `avg_checkpoints.py` script for post training weight averaging and update all scripts with header docstrings and shebangs.
49+
50+
### Dec 30, 2019
51+
* 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
52+
53+
### Dec 28, 2019
54+
* Add new model weights and training hparams (see Training Hparams section)
55+
* `efficientnet_b3` - 81.5 top-1, 95.7 top-5 at default res/crop, 81.9, 95.8 at 320x320 1.0 crop-pct
56+
* trained with RandAugment, ended up with an interesting but less than perfect result (see training section)
57+
* `seresnext26d_32x4d`- 77.6 top-1, 93.6 top-5
58+
* deep stem (32, 32, 64), avgpool downsample
59+
* stem/dowsample from bag-of-tricks paper
60+
* `seresnext26t_32x4d`- 78.0 top-1, 93.7 top-5
61+
* deep tiered stem (24, 48, 64), avgpool downsample (a modified 'D' variant)
62+
* stem sizing mods from Jeremy Howard and fastai devs discussing ResNet architecture experiments
63+
64+
### Dec 23, 2019
65+
* Add RandAugment trained MixNet-XL weights with 80.48 top-1.
66+
* `--dist-bn` argument added to train.py, will distribute BN stats between nodes after each train epoch, before eval
67+
68+
### Dec 4, 2019
69+
* 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).
70+
71+
### Nov 29, 2019
72+
* Brought EfficientNet and MobileNetV3 up to date with my https://github.com/rwightman/gen-efficientnet-pytorch code. Torchscript and ONNX export compat excluded.
73+
* AdvProp weights added
74+
* Official TF MobileNetv3 weights added
75+
* 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...
76+
* HRNet classification models and weights added from https://github.com/HRNet/HRNet-Image-Classification
77+
* Consistency in global pooling, `reset_classifer`, and `forward_features` across models
78+
* `forward_features` always returns unpooled feature maps now
79+
* Reasonable chance I broke something... let me know
80+
81+
### Nov 22, 2019
82+
* 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.
83+
* `drop-connect` cmd line arg finally added to `train.py`, no need to hack model fns. Works for efficientnet/mobilenetv3 based models, ignored otherwise.

docs/changes.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# Changes
2+
3+
### Aug 1, 2020
4+
Universal feature extraction, new models, new weights, new test sets.
5+
* All models support the `features_only=True` argument for `create_model` call to return a network that extracts features from the deepest layer at each stride.
6+
* New models
7+
* CSPResNet, CSPResNeXt, CSPDarkNet, DarkNet
8+
* ReXNet
9+
* (Aligned) Xception41/65/71 (a proper port of TF models)
10+
* New trained weights
11+
* SEResNet50 - 80.3
12+
* CSPDarkNet53 - 80.1 top-1
13+
* CSPResNeXt50 - 80.0 to-1
14+
* DPN68b - 79.2 top-1
15+
* EfficientNet-Lite0 (non-TF ver) - 75.5 (submitted by @hal-314)
16+
* Add 'real' labels for ImageNet and ImageNet-Renditions test set, see [`results/README.md`](results/README.md)
17+
118
### June 11, 2020
219
Bunch of changes:
320

@@ -35,28 +52,3 @@ Bunch of changes:
3552
### March 18, 2020
3653
* Add EfficientNet-Lite models w/ weights ported from [Tensorflow TPU](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet/lite)
3754
* Add RandAugment trained ResNeXt-50 32x4d weights with 79.8 top-1. Trained by [Andrew Lavin](https://github.com/andravin) (see Training section for hparams)
38-
39-
### Feb 29, 2020
40-
* New MobileNet-V3 Large weights trained from stratch with this code to 75.77% top-1
41-
* IMPORTANT CHANGE - default weight init changed for all MobilenetV3 / EfficientNet / related models
42-
* overall results similar to a bit better training from scratch on a few smaller models tried
43-
* performance early in training seems consistently improved but less difference by end
44-
* set `fix_group_fanout=False` in `_init_weight_goog` fn if you need to reproducte past behaviour
45-
* Experimental LR noise feature added applies a random perturbation to LR each epoch in specified range of training
46-
47-
### Feb 18, 2020
48-
* Big refactor of model layers and addition of several attention mechanisms. Several additions motivated by 'Compounding the Performance Improvements...' (https://arxiv.org/abs/2001.06268):
49-
* Move layer/module impl into `layers` subfolder/module of `models` and organize in a more granular fashion
50-
* ResNet downsample paths now properly support dilation (output stride != 32) for avg_pool ('D' variant) and 3x3 (SENets) networks
51-
* Add Selective Kernel Nets on top of ResNet base, pretrained weights
52-
* skresnet18 - 73% top-1
53-
* skresnet34 - 76.9% top-1
54-
* skresnext50_32x4d (equiv to SKNet50) - 80.2% top-1
55-
* ECA and CECA (circular padding) attention layer contributed by [Chris Ha](https://github.com/VRandme)
56-
* CBAM attention experiment (not the best results so far, may remove)
57-
* Attention factory to allow dynamically selecting one of SE, ECA, CBAM in the `.se` position for all ResNets
58-
* Add DropBlock and DropPath (formerly DropConnect for EfficientNet/MobileNetv3) support to all ResNet variants
59-
* Full dataset results updated that incl NoisyStudent weights and 2 of the 3 SK weights
60-
61-
### Feb 12, 2020
62-
* Add EfficientNet-L2 and B0-B7 NoisyStudent weights ported from [Tensorflow TPU](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet)

docs/index.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Getting Started
22

3-
43
## Install
54

65
The library can be installed with pip:
@@ -10,20 +9,21 @@ pip install timm
109
```
1110

1211
!!! info "Conda Environment"
13-
All development and testing has been done in Conda Python 3 environments
14-
on Linux x86-64 systems, specifically Python 3.6.x and 3.7.x.
15-
16-
To install `timm` in a conda environment:
12+
All development and testing has been done in Conda Python 3 environments on Linux x86-64 systems, specifically Python 3.6.x, 3.7.x., 3.8.x.
13+
14+
Little to no care has been taken to be Python 2.x friendly and will not support it. If you run into any challenges running on Windows, or other OS, I'm definitely open to looking into those issues so long as it's in a reproducible (read Conda) environment.
15+
16+
PyTorch versions 1.4, 1.5.x, and 1.6 have been tested with this code.
17+
18+
I've tried to keep the dependencies minimal, the setup is as per the PyTorch default install instructions for Conda:
1719
```
1820
conda create -n torch-env
1921
conda activate torch-env
20-
conda install -c pytorch pytorch torchvision cudatoolkit=10.1
22+
conda install -c pytorch pytorch torchvision cudatoolkit=10.2
2123
conda install pyyaml
22-
pip install timm
2324
```
2425

25-
26-
## Load Pretrained Model
26+
## Load a Pretrained Model
2727

2828
Pretrained models can be loaded using `timm.create_model`
2929

@@ -34,5 +34,35 @@ m = timm.create_model('mobilenetv3_100', pretrained=True)
3434
m.eval()
3535
```
3636

37-
To load a different model see [the list of pretrained weights](/models
38-
/#pretrained-imagenet-weights).
37+
## List Models with Pretrained Weights
38+
```python
39+
import timm
40+
from pprint import pprint
41+
m = timm.create_model('mobilenetv3_large_100', pretrained=True)
42+
pprint(timm.list_models(pretrained=True))
43+
>>> ['adv_inception_v3',
44+
'cspdarknet53',
45+
'cspresnext50',
46+
'densenet121',
47+
'densenet161',
48+
'densenet169',
49+
'densenet201',
50+
'densenetblur121d',
51+
'dla34',
52+
'dla46_c',
53+
...
54+
]
55+
```
56+
57+
## List Model Architectures by Wildcard
58+
```python
59+
import timm
60+
from pprint import pprint
61+
pprint(timm.list_models('*resne*t*'))
62+
>>> ['cspresnet50',
63+
'cspresnet50d',
64+
'cspresnet50w',
65+
'cspresnext50',
66+
...
67+
]
68+
```

0 commit comments

Comments
 (0)