Skip to content

Commit 5c7d298

Browse files
committed
Update README.md, documentation, add TOC, sponsors, and links to timmdocs and paperswithcode
1 parent f1f332f commit 5c7d298

File tree

6 files changed

+116
-48
lines changed

6 files changed

+116
-48
lines changed

README.md

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
# PyTorch Image Models, etc
1+
# PyTorch Image Models
2+
- [Sponsors](#sponsors)
3+
- [What's New](#whats-new)
4+
- [Introduction](#introduction)
5+
- [Models](#models)
6+
- [Features](#features)
7+
- [Results](#results)
8+
- [Getting Started (Documentation)](#getting-started-documentation)
9+
- [Train, Validation, Inference Scripts](#train-validation-inference-scripts)
10+
- [Awesome PyTorch Resources](#awesome-pytorch-resources)
11+
- [Licenses](#licenses)
12+
- [Citing](#citing)
13+
14+
## Sponsors
15+
16+
A big thank you to my [GitHub Sponsors](https://github.com/sponsors/rwightman) for their support!
17+
18+
In addition to the sponsors at the link above, I've received hardware and/or cloud resources from
19+
* Nvidia (https://www.nvidia.com/en-us/)
20+
* TFRC (https://www.tensorflow.org/tfrc)
21+
22+
I'm fortunate to be able to dedicate significant time and money of my own supporting this and other open source projects. However, as the projects increase in scope, outside support is needed to continue with the current trajectory of hardware, infrastructure, and electricty costs.
223

324
## What's New
425

@@ -120,45 +141,6 @@
120141
* Support for native Torch AMP and channels_last memory format added to train/validate scripts (`--channels-last`, `--native-amp` vs `--apex-amp`)
121142
* Models tested with channels_last on latest NGC 20.08 container. AdaptiveAvgPool in attn layers changed to mean((2,3)) to work around bug with NHWC kernel.
122143

123-
### Aug 12, 2020
124-
* New/updated weights from training experiments
125-
* EfficientNet-B3 - 82.1 top-1 (vs 81.6 for official with AA and 81.9 for AdvProp)
126-
* RegNetY-3.2GF - 82.0 top-1 (78.9 from official ver)
127-
* CSPResNet50 - 79.6 top-1 (76.6 from official ver)
128-
* Add CutMix integrated w/ Mixup. See [pull request](https://github.com/rwightman/pytorch-image-models/pull/218) for some usage examples
129-
* Some fixes for using pretrained weights with `in_chans` != 3 on several models.
130-
131-
### Aug 5, 2020
132-
Universal feature extraction, new models, new weights, new test sets.
133-
* All models support the `features_only=True` argument for `create_model` call to return a network that extracts feature maps from the deepest layer at each stride.
134-
* New models
135-
* CSPResNet, CSPResNeXt, CSPDarkNet, DarkNet
136-
* ReXNet
137-
* (Modified Aligned) Xception41/65/71 (a proper port of TF models)
138-
* New trained weights
139-
* SEResNet50 - 80.3 top-1
140-
* CSPDarkNet53 - 80.1 top-1
141-
* CSPResNeXt50 - 80.0 top-1
142-
* DPN68b - 79.2 top-1
143-
* EfficientNet-Lite0 (non-TF ver) - 75.5 (submitted by [@hal-314](https://github.com/hal-314))
144-
* Add 'real' labels for ImageNet and ImageNet-Renditions test set, see [`results/README.md`](results/README.md)
145-
* Test set ranking/top-n diff script by [@KushajveerSingh](https://github.com/KushajveerSingh)
146-
* Train script and loader/transform tweaks to punch through more aug arguments
147-
* README and documentation overhaul. See initial (WIP) documentation at https://rwightman.github.io/pytorch-image-models/
148-
* adamp and sgdp optimizers added by [@hellbell](https://github.com/hellbell)
149-
150-
### June 11, 2020
151-
Bunch of changes:
152-
* DenseNet models updated with memory efficient addition from torchvision (fixed a bug), blur pooling and deep stem additions
153-
* VoVNet V1 and V2 models added, 39 V2 variant (ese_vovnet_39b) trained to 79.3 top-1
154-
* Activation factory added along with new activations:
155-
* select act at model creation time for more flexibility in using activations compatible with scripting or tracing (ONNX export)
156-
* hard_mish (experimental) added with memory-efficient grad, along with ME hard_swish
157-
* context mgr for setting exportable/scriptable/no_jit states
158-
* Norm + Activation combo layers added with initial trial support in DenseNet and VoVNet along with impl of EvoNorm and InplaceAbn wrapper that fit the interface
159-
* Torchscript works for all but two of the model types as long as using Pytorch 1.5+, tests added for this
160-
* Some import cleanup and classifier reset changes, all models will have classifier reset to nn.Identity on reset_classifer(0) call
161-
* Prep for 0.1.28 pip release
162144

163145
## Introduction
164146

@@ -271,9 +253,13 @@ Several (less common) features that I often utilize in my projects are included.
271253

272254
Model validation results can be found in the [documentation](https://rwightman.github.io/pytorch-image-models/results/) and in the [results tables](results/README.md)
273255

274-
## Getting Started
256+
## Getting Started (Documentation)
257+
258+
My current [documentation](https://rwightman.github.io/pytorch-image-models/) for `timm` covers the basics.
259+
260+
[timmdocs](https://fastai.github.io/timmdocs/) is quickly becoming a much more comprehensive set of documentation for `timm`. A big thanks to [Aman Arora](https://github.com/amaarora) for his efforts creating timmdocs.
275261

276-
See the [documentation](https://rwightman.github.io/pytorch-image-models/)
262+
[paperswithcode](https://paperswithcode.com/lib/timm) is a good resource for browsing the models within `timm`.
277263

278264
## Train, Validation, Inference Scripts
279265

docs/archived_changes.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Archived Changes
22

3+
### Aug 12, 2020
4+
* New/updated weights from training experiments
5+
* EfficientNet-B3 - 82.1 top-1 (vs 81.6 for official with AA and 81.9 for AdvProp)
6+
* RegNetY-3.2GF - 82.0 top-1 (78.9 from official ver)
7+
* CSPResNet50 - 79.6 top-1 (76.6 from official ver)
8+
* Add CutMix integrated w/ Mixup. See [pull request](https://github.com/rwightman/pytorch-image-models/pull/218) for some usage examples
9+
* Some fixes for using pretrained weights with `in_chans` != 3 on several models.
10+
11+
### Aug 5, 2020
12+
Universal feature extraction, new models, new weights, new test sets.
13+
* All models support the `features_only=True` argument for `create_model` call to return a network that extracts feature maps from the deepest layer at each stride.
14+
* New models
15+
* CSPResNet, CSPResNeXt, CSPDarkNet, DarkNet
16+
* ReXNet
17+
* (Modified Aligned) Xception41/65/71 (a proper port of TF models)
18+
* New trained weights
19+
* SEResNet50 - 80.3 top-1
20+
* CSPDarkNet53 - 80.1 top-1
21+
* CSPResNeXt50 - 80.0 top-1
22+
* DPN68b - 79.2 top-1
23+
* EfficientNet-Lite0 (non-TF ver) - 75.5 (submitted by [@hal-314](https://github.com/hal-314))
24+
* Add 'real' labels for ImageNet and ImageNet-Renditions test set, see [`results/README.md`](results/README.md)
25+
* Test set ranking/top-n diff script by [@KushajveerSingh](https://github.com/KushajveerSingh)
26+
* Train script and loader/transform tweaks to punch through more aug arguments
27+
* README and documentation overhaul. See initial (WIP) documentation at https://rwightman.github.io/pytorch-image-models/
28+
* adamp and sgdp optimizers added by [@hellbell](https://github.com/hellbell)
29+
30+
### June 11, 2020
31+
Bunch of changes:
32+
* DenseNet models updated with memory efficient addition from torchvision (fixed a bug), blur pooling and deep stem additions
33+
* VoVNet V1 and V2 models added, 39 V2 variant (ese_vovnet_39b) trained to 79.3 top-1
34+
* Activation factory added along with new activations:
35+
* select act at model creation time for more flexibility in using activations compatible with scripting or tracing (ONNX export)
36+
* hard_mish (experimental) added with memory-efficient grad, along with ME hard_swish
37+
* context mgr for setting exportable/scriptable/no_jit states
38+
* Norm + Activation combo layers added with initial trial support in DenseNet and VoVNet along with impl of EvoNorm and InplaceAbn wrapper that fit the interface
39+
* Torchscript works for all but two of the model types as long as using Pytorch 1.5+, tests added for this
40+
* Some import cleanup and classifier reset changes, all models will have classifier reset to nn.Identity on reset_classifer(0) call
41+
* Prep for 0.1.28 pip release
42+
343
### May 12, 2020
444
* Add ResNeSt models (code adapted from https://github.com/zhanghang1989/ResNeSt, paper https://arxiv.org/abs/2004.08955))
545

docs/changes.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# Recent Changes
22

3+
### March 7, 2021
4+
* First 0.4.x PyPi release w/ NFNets (& related), ByoB (GPU-Efficient, RepVGG, etc).
5+
* Change feature extraction for pre-activation nets (NFNets, ResNetV2) to return features before activation.
6+
7+
### Feb 18, 2021
8+
* Add pretrained weights and model variants for NFNet-F* models from [DeepMind Haiku impl](https://github.com/deepmind/deepmind-research/tree/master/nfnets).
9+
* Models are prefixed with `dm_`. They require SAME padding conv, skipinit enabled, and activation gains applied in act fn.
10+
* These models are big, expect to run out of GPU memory. With the GELU activiation + other options, they are roughly 1/2 the inference speed of my SiLU PyTorch optimized `s` variants.
11+
* Original model results are based on pre-processing that is not the same as all other models so you'll see different results in the results csv (once updated).
12+
* Matching the original pre-processing as closely as possible I get these results:
13+
* `dm_nfnet_f6` - 86.352
14+
* `dm_nfnet_f5` - 86.100
15+
* `dm_nfnet_f4` - 85.834
16+
* `dm_nfnet_f3` - 85.676
17+
* `dm_nfnet_f2` - 85.178
18+
* `dm_nfnet_f1` - 84.696
19+
* `dm_nfnet_f0` - 83.464
20+
21+
### Feb 16, 2021
22+
* Add Adaptive Gradient Clipping (AGC) as per https://arxiv.org/abs/2102.06171. Integrated w/ PyTorch gradient clipping via mode arg that defaults to prev 'norm' mode. For backward arg compat, clip-grad arg must be specified to enable when using train.py.
23+
* AGC w/ default clipping factor `--clip-grad .01 --clip-mode agc`
24+
* PyTorch global norm of 1.0 (old behaviour, always norm), `--clip-grad 1.0`
25+
* PyTorch value clipping of 10, `--clip-grad 10. --clip-mode value`
26+
* AGC performance is definitely sensitive to the clipping factor. More experimentation needed to determine good values for smaller batch sizes and optimizers besides those in paper. So far I've found .001-.005 is necessary for stable RMSProp training w/ NFNet/NF-ResNet.
27+
28+
### Feb 12, 2021
29+
* Update Normalization-Free nets to include new NFNet-F (https://arxiv.org/abs/2102.06171) model defs
30+
331
### Feb 10, 2021
432
* More model archs, incl a flexible ByobNet backbone ('Bring-your-own-blocks')
533
* GPU-Efficient-Networks (https://github.com/idstcv/GPU-Efficient-Networks), impl in `byobnet.py`

docs/index.md

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

3+
## Welcome
4+
5+
Welcome to the `timm` documentation, a lean set of docs that covers the basics of `timm`.
6+
7+
For a more comprehensive set of docs (currently under development), please visit [timmdocs](https://fastai.github.io/timmdocs/) by [Aman Arora](https://github.com/amaarora).
8+
39
## Install
410

511
The library can be installed with pip:
@@ -8,18 +14,23 @@ The library can be installed with pip:
814
pip install timm
915
```
1016

17+
I update the PyPi (pip) packages when I'm confident there are no significant model regressions from previous releases. If you want to pip install the bleeding edge from GitHub, use:
18+
```
19+
pip install git+https://github.com/rwightman/pytorch-image-models.git
20+
```
21+
1122
!!! info "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.
23+
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., 3.9
1324

1425
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.
1526

16-
PyTorch versions 1.4, 1.5.x, 1.6, and 1.7 have been tested with this code.
27+
PyTorch versions 1.4, 1.5.x, 1.6, 1.7.x, and 1.8 have been tested with this code.
1728

1829
I've tried to keep the dependencies minimal, the setup is as per the PyTorch default install instructions for Conda:
1930
```
2031
conda create -n torch-env
2132
conda activate torch-env
22-
conda install -c pytorch pytorch torchvision cudatoolkit=11
33+
conda install pytorch torchvision cudatoolkit=11.1 -c pytorch -c conda-forge
2334
conda install pyyaml
2435
```
2536

docs/models.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Most included models have pretrained weights. The weights are either:
88
2. ported by myself from their original impl in a different framework (e.g. Tensorflow models)
99
3. trained from scratch using the included training script
1010

11-
The validation results for the pretrained weights can be found [here](results.md)
11+
The validation results for the pretrained weights are [here](results.md)
12+
13+
A more exciting view (with pretty pictures) of the models within `timm` can be found at [paperswithcode](https://paperswithcode.com/lib/timm).
1214

1315
## Big Transfer ResNetV2 (BiT) [[resnetv2.py](https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/resnetv2.py)]
1416
* Paper: `Big Transfer (BiT): General Visual Representation Learning` - https://arxiv.org/abs/1912.11370

docs/results.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Results
22

3-
CSV files containing an ImageNet-1K validation and out-of-distribution (OOD) test set validation results for all included models with pretrained weights and default configurations is located [here](https://github.com/rwightman/pytorch-image-models/tree/master/results).
3+
CSV files containing an ImageNet-1K and out-of-distribution (OOD) test set validation results for all models with pretrained weights is located in the repository [results folder](https://github.com/rwightman/pytorch-image-models/tree/master/results).
44

55
## Self-trained Weights
6-
I've leveraged the training scripts in this repository to train a few of the models with to good levels of performance.
6+
7+
The table below includes ImageNet-1k validation results of model weights that I've trained myself. It is not updated as frequently as the csv results outputs linked above.
78

89
|Model | Acc@1 (Err) | Acc@5 (Err) | Param # (M) | Interpolation | Image Size |
910
|---|---|---|---|---|---|

0 commit comments

Comments
 (0)