Ross Wightman
c88947ad3d
Add initial Hugging Face Datasets parser impl.
2022-09-23 16:08:19 -07:00
Ross Wightman
e069249a2d
Add hf hub entries for laion2b clip models, add huggingface_hub dependency, update some setup/reqs, torch >= 1.7
2022-09-16 21:39:05 -07:00
Ross Wightman
9be0c84715
Change set -> dict w/ None keys for dataset split synonym search, so always consistent if more than 1 exists. Fix #1224
2022-07-07 15:33:53 -07:00
Ross Wightman
bfc0dccb0e
Improve image extension handling, add methods to modify / get defaults. Fix #1335 fix #1274 .
2022-07-07 14:23:20 -07:00
Ross Wightman
70d6d2c484
support test_crop_size in data config resolve
2022-07-02 15:17:05 -07:00
Ross Wightman
7cedc8d474
Follow up to #1256 , fix interpolation warning in auto_autoaugment as well
2022-06-21 14:56:53 -07:00
Jakub Kaczmarzyk
db64393c0d
use `Image.Resampling` namespace for PIL mapping ( #1256 )
...
* use `Image.Resampling` namespace for PIL mapping
PIL shows a deprecation warning when accessing resampling constants via the `Image` namespace. The suggested namespace is `Image.Resampling`. This commit updates `_pil_interpolation_to_str` to use the `Image.Resampling` namespace.
```
/tmp/ipykernel_11959/698124036.py:2: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
Image.NEAREST: 'nearest',
/tmp/ipykernel_11959/698124036.py:3: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
Image.BILINEAR: 'bilinear',
/tmp/ipykernel_11959/698124036.py:4: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
Image.BICUBIC: 'bicubic',
/tmp/ipykernel_11959/698124036.py:5: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
Image.BOX: 'box',
/tmp/ipykernel_11959/698124036.py:6: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
Image.HAMMING: 'hamming',
/tmp/ipykernel_11959/698124036.py:7: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
Image.LANCZOS: 'lanczos',
```
* use new pillow resampling enum only if it exists
2022-06-12 22:30:57 -07:00
Junming Chen
569d114ef7
Fix device problem
...
Before, the one_hot could only run in device='cuda'. Now it will run on input device automatically.
2022-04-19 11:53:18 +08:00
Ross Wightman
372ad5fa0d
Significant model refactor and additions:
...
* All models updated with revised foward_features / forward_head interface
* Vision transformer and MLP based models consistently output sequence from forward_features (pooling or token selection considered part of 'head')
* WIP param grouping interface to allow consistent grouping of parameters for layer-wise decay across all model types
* Add gradient checkpointing support to a significant % of models, especially popular architectures
* Formatting and interface consistency improvements across models
* layer-wise LR decay impl part of optimizer factory w/ scale support in scheduler
* Poolformer and Volo architectures added
2022-02-28 13:56:23 -08:00
Ross Wightman
95cfc9b3e8
Merge remote-tracking branch 'origin/master' into norm_norm_norm
2022-01-25 22:20:45 -08:00
Ross Wightman
656757d26b
Fix MobileNetV2 head conv size for multiplier < 1.0. Add some missing modification copyrights, fix starting date of some old ones.
2022-01-14 16:28:27 -08:00
Ross Wightman
02ae11e526
Leaving repeat aug sampler indices as tensor thrashes worker shared process memory
2022-01-06 22:33:09 -08:00
Ross Wightman
de5fa791c6
Merge branch 'master' into norm_norm_norm
2022-01-03 11:37:00 -08:00
Hyeongchan Kim
a0b2657497
Use `torch.repeat_interleave()` to generate repeated indices faster ( #1058 )
...
* update: use numpy to generate repeated indices faster
* update: use torch.repeat_interleave() instead of np.repeat()
* refactor: remove unused import, numpy
* refactor: torch.range to torch.arange
* update: tensor to list before appending the extra samples
* update: concatenate the paddings with torch.cat
2022-01-02 14:01:06 -08:00
Ross Wightman
55adfbeb8d
Add commented code to increase open file limit via Python (for TFDS dataset building)
2021-11-30 17:02:27 -08:00
Ross Wightman
78b36bf46c
Places365 doesn't exist in some still used torchvision version
2021-11-18 14:59:51 -08:00
Ross Wightman
cfa414cad2
Matching two bits_and_tpu changes for TFDs wrapper
...
* change 'samples' -> 'examples' for tfds wrapper to match tfds naming
* add class_to_idx for image classification datasets in tfds wrapper
2021-11-14 12:52:19 -08:00
Ross Wightman
9ec3210c2d
More TFDS parser cleanup, support improved TFDS even_split impl (on tfds-nightly only currently).
2021-11-10 15:52:09 -08:00
Ross Wightman
ba65dfe2c6
Dataset work
...
* support some torchvision datasets
* improvements to TFDS wrapper for subsplit handling (fix #942 ), shuffle seed
* add class-map support to train (fix #957 )
2021-11-09 22:34:15 -08:00
Ross Wightman
a41de1f666
Add interpolation mode handling to transforms. Removes InterpolationMode warning. Works for torchvision versions w/ and w/o InterpolationMode enum. Fix #738 .
2021-10-28 17:35:01 -07:00
Ross Wightman
ed41d32637
Add repr to auto_augment and random_erasing impl
2021-10-28 17:33:36 -07:00
masafumi
047a5ec05f
Fix bugs that Mixup does not work device=cpu
2021-10-12 23:51:46 +09:00
Ross Wightman
80075b0b8a
Add worker_seeding arg to allow selecting old vs updated data loader worker seed for (old) experiment repeatability
2021-09-28 16:37:45 -07:00
Ross Wightman
f8a63a3b71
Add worker_init_fn to loader for numpy seed per worker
2021-09-23 15:44:38 -07:00
Ross Wightman
fb94350896
Update training script and loader factory to allow use of scheduler updates, repeat augment, and bce loss
2021-09-01 17:46:40 -07:00
Ross Wightman
f262137ff2
Add RepeatAugSampler as per DeiT RASampler impl, showing promise for current (distributed) training experiments.
2021-09-01 17:40:53 -07:00
Ross Wightman
3cdaf5ed56
Add `mmax` config key to auto_augment for increasing upper bound of RandAugment magnitude beyond 10. Make AugMix uniform sampling default not override config setting.
2021-08-12 15:39:05 -07:00
Ross Wightman
d53e91218e
Fix tf.data options setting for newer TF versions
2021-05-15 22:56:12 -07:00
Norman Mu
79640fcc1f
Enable uniform augmentation magnitude sampling and set AugMix default
2021-04-19 14:21:12 -07:00
Ross Wightman
a5310a3451
Merge remote-tracking branch 'origin/benchmark-fixes-vit_hybrids' into pit_and_vit_update
2021-04-01 12:15:34 -07:00
Ross Wightman
f42f1df26c
Improve evenness of per-worker split for validation set with TFDS
2021-03-18 23:16:14 -07:00
Ross Wightman
d584e7f617
Support for huggingface hub via create_model and default_cfgs.
...
* improve consistency of model creation helper fns
* add comments to some of the model helpers
* support passing external default_cfgs so they can be sourced from hub
2021-03-16 22:48:26 -07:00
Ross Wightman
2db2d87ff7
Add epoch-repeats arg to multiply the number of dataset passes per epoch. Currently for iterable datasets (read TFDS wrapper) only.
2021-02-23 17:31:42 -08:00
Ross Wightman
68a4144882
Add new weights for ecaresnet26t/50t/269d models. Remove distinction between 't' and 'tn' (tiered models), tn is now t. Add test time img size spec to default cfg.
2021-02-06 16:30:02 -08:00
Ross Wightman
22748f1a2d
Convert samples/targets in ParserImageInTar to numpy arrays, slightly less mem usage for massive datasets. Add a few more se/eca model defs to resnet.py
2021-01-22 16:54:33 -08:00
Ross Wightman
5d4c3d0af3
Add enhanced ParserImageInTar that can read images from tars within tars, folders with multiple tars, etc. Additional comment cleanup.
2021-01-22 10:52:04 -08:00
Ross Wightman
855d6cc217
More dataset work including factories and a tensorflow datasets (TFDS) wrapper
...
* Add parser/dataset factory methods for more flexible dataset & parser creation
* Add dataset parser that wraps TFDS image classification datasets
* Tweak num_classes handling bug for 21k models
* Add initial deit models so they can be benchmarked in next csv results runs
2021-01-15 17:26:20 -08:00
Ross Wightman
59ec7e6a53
Merge branch 'master' into imagenet21k_datasets_more
2021-01-04 12:11:05 -08:00
Ross Wightman
e7a9ddf982
Merge pull request #334 from kecsap/links
...
Follow symbolic links during dataset scanning
2021-01-04 10:30:58 -08:00
Csaba Kertesz
7cae7e7035
Follow links during dataset scanning
2021-01-04 00:16:45 +02:00
Ross Wightman
0167f749d3
Remove some old __future__ imports
2021-01-03 11:24:16 -08:00
Ross Wightman
e35e9760a6
More work on dataset / parser split and imagenet21k (tar) support
2020-12-28 16:59:15 -08:00
Ross Wightman
de6046e213
Initial commit for dataset / parser reorg to support additional datasets / types
2020-12-28 16:59:15 -08:00
Tymoteusz Wiśniewski
de15b43865
Fix a bug with accuracy retrieving from RealLabels
2020-12-04 16:12:50 +01:00
Ross Wightman
e8ca45854c
More models in sotabench, more control over sotabench run, dataset filename extraction consistency
2020-09-24 15:56:57 -07:00
Ross Wightman
47a7b3b5b1
More flexible mixup mode, add 'half' mode.
2020-09-07 20:03:06 -07:00
Ross Wightman
8c9814e3f5
Final cleanup of mixup/cutmix. Element/batch modes working with both collate (prefetcher active) and without prefetcher.
2020-08-12 17:01:32 -07:00
Ross Wightman
cd23f55397
Fix mixed prec issues with new mixup code
2020-08-11 12:17:43 -07:00
Ross Wightman
f471c17c9d
More cutmix/mixup overhaul, ready to kick-off some trials.
2020-08-11 00:10:33 -07:00
Ross Wightman
92f2d0d65d
Merge branch 'master' into cutmix. Fixup a few issues.
2020-08-07 15:59:52 -07:00
Santiago Castro
0f75d48a66
Fix class name
2020-08-07 16:26:00 -04:00
Santiago Castro
feaa3abc51
Fix MultiEpochsDataLoader when there's no batching
2020-08-07 16:25:14 -04:00
Ross Wightman
e62758cf4f
More documentation updates, fix a typo
2020-08-05 15:59:31 -07:00
Ross Wightman
fa28067704
Add more augmentation arguments, including a no_aug disable flag. Fix #209
2020-08-05 13:16:44 -07:00
Ross Wightman
c53ec33ae0
Add synset/label indices for results generation. Add 'valid labels' to validation script to support imagenet-a/r label subsets properly.
2020-07-29 00:58:57 -07:00
Ross Wightman
7995295968
Merge branch 'logger' into features. Change 'logger' to '_logger'.
2020-07-27 18:00:46 -07:00
Ross Wightman
6c17d57a2c
Fix some attributions, add copyrights to some file docstrings
2020-07-27 13:44:56 -07:00
Ross Wightman
d23a2697d0
Working on feature extraction, interfaces refined, a number of models working, some in progress.
2020-06-29 18:18:59 -07:00
Antoine Broyelle
78fa0772cc
Leverage python hierachical logger
...
with this update one can tune the kind of logs generated by timm but
training and inference traces are unchanged
2020-06-09 18:28:48 +01:00
AFLALO, Jonathan Isaac
a7f570c9b7
added MultiEpochsDataLoader
2020-05-05 14:47:02 +03:00
Ross Wightman
64fe37d008
Remove old mean/std helper, rely fully on cmd line or default_cfg now. Fixes #126
2020-04-27 12:32:55 -07:00
Ross Wightman
670c61b28f
Some cutmix/mixup cleanup/fixes
2020-02-17 11:00:54 -08:00
Ross Wightman
b3cb5f3275
Working on CutMix impl as per #8 , integrating with Mixup, currently experimenting...
2020-02-16 20:09:11 -08:00
Ross Wightman
d66819d1f3
Indentation mistake. Fixes #81
2020-02-04 22:56:00 -08:00
Ross Wightman
1daa303744
Add support to Dataset for class id mapping file, clean up a bit of old logic. Add results file arg for validation and update script.
2020-02-01 18:07:32 -08:00
Ross Wightman
d9a6a9d0af
Merge pull request #74 from rwightman/augmix-jsd
...
AugMix, JSD loss, SplitBatchNorm (Auxiliary BN), and more
2020-01-11 12:04:29 -08:00
Ross Wightman
3eb4a96eda
Update AugMix, JSD, etc comments and references
2020-01-11 12:02:05 -08:00
Ross Wightman
7547119891
Add SplitBatchNorm. AugMix, Rand/AutoAugment, Split (Aux) BatchNorm, Jensen-Shannon Divergence, RandomErasing all working together
2020-01-05 19:58:59 -08:00
Ross Wightman
2e955cfd0c
Update RandomErasing with some improved arg names, tweak to aspect range
2020-01-05 14:31:48 -08:00
Ross Wightman
3cc0f91e23
Fix augmix variable name scope overlap, default non-blended mode
2020-01-05 14:27:27 -08:00
Ross Wightman
4666cc9aed
Add --pin-mem arg to enable dataloader pin_memory (showing more benefit in some scenarios now), also add --torchscript arg to validate.py for testing models with jit.script
2020-01-02 16:22:06 -08:00
Ross Wightman
3afc2a4dc0
Some cleanup/improvements to AugMix impl:
...
* make 'increasing' levels for Contrast, Color, Brightness, Saturation ops
* remove recursion from faster blending mix
* add config striing parsing for AugMix
2019-12-20 23:04:11 -08:00
Ross Wightman
232ab7fb12
Working on an implementation of AugMix with JensenShannonDivergence loss that's compatible with my AutoAugment and RandAugment impl
2019-12-20 23:04:11 -08:00
Ross Wightman
0161de0127
Switch RandoErasing back to on GPU normal sampling
2019-12-05 22:35:08 -08:00
Ross Wightman
31453b039e
Update Auto/RandAugment comments, README, more.
...
* Add a weighted choice option for RandAugment
* Adjust magnitude noise/std naming, config
2019-11-22 13:24:52 -08:00
Ross Wightman
4243f076f1
Adding RandAugment to AutoAugment impl, some tweaks to AA included
2019-11-21 21:14:33 -08:00
Ross Wightman
4002c0d4ce
Fix AutoAugment abs translate calc
2019-09-01 22:07:45 -07:00
Ross Wightman
c06274e5a2
Add note on random selection of magnitude value
2019-09-01 20:32:26 -07:00
Ross Wightman
b750b76f67
More AutoAugment work. Ready to roll...
2019-09-01 16:55:42 -07:00
Ross Wightman
25d2088d9e
Working on auto-augment
2019-08-31 23:09:48 -07:00
Ross Wightman
f37e633e9b
Merge remote-tracking branch 'origin/re-exp' into opt
2019-08-26 14:29:23 -07:00
Ross Wightman
daeaa113e2
Add initial sotabench attempt. Split create_transform out of create_loader. Update requirements.txt
2019-08-12 23:06:19 -07:00
Ross Wightman
66634d2200
Add support to split random erasing blocks into randomly selected number with --recount arg. Fix random selection of aspect ratios.
2019-08-12 16:01:58 -07:00
Ross Wightman
6946281fde
Experimenting with random erasing changes
2019-08-12 16:01:58 -07:00
Ross Wightman
dfa9298b4e
Add MixNet ( https://arxiv.org/abs/1907.09595 ) with pretrained weights converted from Tensorflow impl
...
* refactor 'same' convolution and add helper to use MixedConv2d when needed
* improve performance of 'same' padding for cases that can be handled statically
* add support for extra exp, pw, and dw kernel specs with grouping support to decoder/string defs for MixNet
* shuffle some args for a bit more consistency, a little less clutter overall in gen_efficientnet.py
2019-07-25 11:42:01 -07:00
Ross Wightman
7a92caa560
Add basic image folder style dataset to read directly out of tar files, example in validate.py
2019-07-25 10:51:03 -07:00
Ross Wightman
6cdf35e670
Add explicit half/fp16 support to loader and validation script
2019-07-05 13:52:25 -07:00
Ross Wightman
65a634626f
Switch random erasing to doing normal_() on CPU to avoid instability, remove a debug print
2019-06-29 10:03:13 -07:00
Ross Wightman
c6b32cbe73
A number of tweaks to arguments, epoch handling, config
...
* reorganize train args
* allow resolve_data_config to be used with dict args, not just arparse
* stop incrementing epoch before save, more consistent naming vs csv, etc
* update resume and start epoch handling to match above
* stop auto-incrementing epoch in scheduler
2019-06-28 13:49:20 -07:00
Ross Wightman
6fc886acaf
Remove all prints, change most to logging calls, tweak alignment of batch logs, improve setup.py
2019-06-20 17:29:25 -07:00
Ross Wightman
aa4354f466
Big re-org, working towards making pip/module as 'timm'
2019-06-19 17:20:51 -07:00