Commit Graph

36 Commits (80a48773763bc7148882092562e03b6a118c56f8)

Author SHA1 Message Date
Ryan 80a4877376 Fix self.reset_classifier num_classes update 2025-01-21 11:52:05 -08:00
Ross Wightman f0fb471b26 Remove separate ConvNormActAa class, merge with ConvNormAct 2024-06-10 12:05:35 -07:00
Ross Wightman a5a2ad2e48 Fix consistency, testing for forward_head w/ pre_logits, reset_classifier, models with pre_logits size != unpooled feature size
* add test that model supports forward_head(x, pre_logits=True)
* add head_hidden_size attr to all models and set differently from num_features attr when head has hidden layers
* test forward_features() feat dim == model.num_features and pre_logits feat dim == self.head_hidden_size
* more consistency in reset_classifier signature, add typing
* asserts in some heads where pooling cannot be disabled
Fix #2194
2024-06-07 13:53:00 -07:00
Ross Wightman c838c4233f Add typing to reset_classifier() on other models 2024-05-12 11:12:00 -07:00
Ross Wightman dfaab97d20 More consistency in model arg/kwarg merge handling 2023-11-21 09:48:03 -08:00
Ross Wightman e4e43190ce Add typing to all model entrypoint fns, add old cache check env var to builder 2023-05-08 08:52:38 -07:00
Ross Wightman 6e4529ae35 TResNet weights now on HF hub, modified to remove InplaceABN dependency 2023-04-21 14:20:48 -07:00
Ross Wightman 04dcbc02ec Fix weight remap for tresnet_v2_l 2023-04-21 09:05:04 -07:00
Ross Wightman a08e5aed1d More models w/ multi-weight support, moving to HF hub. Removing inplace_abn from all models including TResNet 2023-04-20 22:44:49 -07:00
Ross Wightman 927f031293 Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00
Ross Wightman a520da9b49 Update tresnet features_info for v2 2022-09-13 20:54:54 -07:00
Ross Wightman e11efa872d Update a bunch of weights with external links to timm release assets. Fixes issue with *aliyuncs.com returning forbidden. Did pickle scan / verify and re-hash. Add TresNet-V2-L weights. 2022-09-13 16:35:26 -07:00
Ross Wightman 1b278136c3 Change models with mean 0,0,0 std 1,1,1 from int to float for consistency as mentioned in #1355 2022-07-21 17:36:15 -07:00
Ross Wightman 0862e6ebae Fix correctness of some group matching regex (no impact on result), some formatting, missed forward_head for resnet 2022-03-19 14:58:54 -07: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 abc9ba2544 Transitioning default_cfg -> pretrained_cfg. Improving handling of pretrained_cfg source (HF-Hub, files, timm config, etc). Checkpoint handling tweaks. 2022-01-25 21:54:13 -08:00
Ross Wightman 742c2d5247 Add Gather-Excite and Global Context attn modules. Refactor existing SE-like attn for consistency and refactor byob/byoanet for less redundancy. 2021-05-27 18:03:29 -07:00
Ross Wightman d5473c17f7 Fix incorrect name of shortcut/identity paths in many residual nets. Inherited from naming in old old torchvision, long fixed there. 2021-05-04 21:27:15 -07:00
Ross Wightman 0d87650fea Remove filter hack from BlurPool w/ non-persistent buffer. Use BlurPool2d instead of AntiAliasing.. for TResNet. Breaks PyTorch < 1.6. 2021-05-04 16:56:28 -07:00
Ross Wightman a0492e3b48 A few miil weights naming tweaks to improve compat with model registry and filtering wildcards. 2021-04-28 10:33:02 -07:00
talrid a443865876 update naming and scores 2021-04-28 08:57:06 +03:00
talrid 0968bdeca3 vit, tresnet and mobilenetV3 ImageNet-21K-P weights 2021-04-27 20:54:06 +03: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 80c9d9cc72 Add 'fast' global pool option, remove redundant SEModule from tresnet, normal one is now 'fast' 2020-09-02 09:11:48 -07:00
Ross Wightman 110a7c4982 AdaptiveAvgPool2d -> mean((2,3)) for all SE/attn layers to avoid NaN with AMP + channels_last layout. See https://github.com/pytorch/pytorch/issues/43992 2020-09-01 16:05:32 -07:00
Yusuke Uchida f6b56602f9 fix test_model_default_cfgs 2020-08-11 23:23:57 +09:00
Ross Wightman 4e61c6a12d Cleanup, refactoring of Feature extraction code, add tests, fix tests, non hook feature extraction working with torchscript 2020-07-20 16:10:31 -07:00
Ross Wightman 3b9004bef9 Lots of changes to model creation helpers, close to finalizing feature extraction / interfaces 2020-07-17 17:54:26 -07:00
Ross Wightman eb7653614f Monster commit, activation refactor, VoVNet, norm_act improvements, more
* refactor activations into basic PyTorch, jit scripted, and memory efficient custom auto
* implement hard-mish, better grad for hard-swish
* add initial VovNet V1/V2 impl, fix #151
* VovNet and DenseNet first models to use NormAct layers (support BatchNormAct2d, EvoNorm, InplaceIABN)
* Wrap IABN for any models that use it
* make more models torchscript compatible (DPN, PNasNet, Res2Net, SelecSLS) and add tests
2020-06-01 17:16:52 -07:00
Ross Wightman 0ea53cecc3 Merge branch 'master' into densenet_update_and_more 2020-05-22 16:18:10 -07:00
Ross Wightman afb6bd0669 Add backward and default_cfg tests and fix a few issues found. Fix #153 2020-05-21 15:30:58 -07:00
Vyacheslav Shults a7ebe09029 Replace all None by nn.Identity() in all models reset_classifier when False-values num_classes is given.
Make small code refactoring
2020-05-06 09:54:03 +03:00
Ross Wightman be7c784d21 Small TResNet simplification, just use SelectAdaptivePool, don't notice any perf difference 2020-04-27 17:50:19 -07:00
Ross Wightman 0004f37d25 Some TResNet cleanup.
* allow use of global pool arg, test-time-pooling
* clean checkpoints to just contain state dict, add 448 res checkpoints
* support DataParallel via lazy filter creation for JIT Downsample
* some minor formatting (mostly alignment) preferences
2020-04-27 13:21:05 -07:00
talrid 8a63c1add8 finalizing 2020-04-12 19:08:35 +03:00
talrid 6209146738 TResNet models 2020-04-12 18:44:12 +03:00