Commit Graph

50 Commits (225f4f92b3738322dfe67f67aa5af47d36c91c37)

Author SHA1 Message Date
Ross Wightman d2240745d3 Fix issue where feature out_indices out of order after wrapping with FeatureGetterNet due to use of set() 2024-07-22 13:33:30 -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 cb57a96862 Fix early stop for efficientnet/mobilenetv3 fwd inter. Fix indices typing for all fwd inter. 2024-05-04 10:21:58 -07:00
Ross Wightman c719f7eb86 More forward_intermediates() updates
* add convnext, resnet, efficientformer, levit support
* remove kwargs only for fn so that torchscript isn't broken for all :(
* use reset_classifier() consistently in prune
2024-05-03 16:22:32 -07:00
Ross Wightman d3e83a190f Add in12k fine-tuned convnext_xxlarge 2023-11-03 14:35:01 -07: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 beef7f0a22 Add ImageNet-12k intermediate fine-tunes of convnext base & large CLIP models, add first 1k fine-tune of xxlarge 2023-03-31 16:45:01 -07:00
Ross Wightman 572f05096a Swin and FocalNet weights on HF hub. Add model deprecation functionality w/ some registry tweaks. 2023-03-18 14:55:09 -07:00
Ross Wightman acfd85ad68 All swin models support spatial output, add output_fmt to v1/v2 and use ClassifierHead.
* update ClassifierHead to allow different input format
* add output format support to patch embed
* fix some flatten issues for a few conv head models
* add Format enum and helpers for tensor format (layout) choices
2023-03-15 23:21:51 -07:00
Ross Wightman ad94d737b7 Add support to ConvNextBlock for downsample and channel expansion to improve stand alone use. Fix #1699 2023-03-13 14:06:24 -07:00
Ross Wightman 4b8cfa6c0a Add convnext_xxlarge CLIP image tower weights, version 0.8.15dev0 2023-02-26 21:51:48 -08:00
Ross Wightman 1c13ef7b46 Add default norm_eps=1e-5 for convnext_xxlarge, improve kwarg merging for all convnext models 2023-02-26 12:11:49 -08:00
Ross Wightman 4d9c3ae2fb Add laion2b 320x320 ConvNeXt-Large CLIP weights 2023-02-18 16:34:03 -08:00
Ross Wightman 0d33127df2 Add 384x384 convnext_large_mlp laion2b fine-tune on in1k 2023-02-06 22:01:04 -08:00
Ross Wightman b3042081b4 Add laion -> in1k fine-tuned base and large_mlp weights for convnext 2023-02-03 10:58:02 -08:00
Ross Wightman 316bdf8955 Add mlp head support for convnext_large, add laion2b CLIP weights, prep fine-tuned weight tags 2023-02-01 08:27:02 -08:00
Ross Wightman 6f28b562c6 Factor NormMlpClassifierHead from MaxxViT and use across MaxxViT / ConvNeXt / DaViT, refactor some type hints & comments 2023-01-27 14:57:01 -08:00
Ross Wightman 8ab573cd26 Add convnext_tiny and convnext_small 384x384 fine-tunes of in12k weights, fix pool size for laion CLIP convnext weights 2023-01-20 14:40:16 -08:00
Ross Wightman e9aac412de Correct mean/std for CLIP convnexts 2023-01-14 22:53:56 -08:00
Ross Wightman 42bd8f7bcb Add convnext_base CLIP image tower weights for fine-tuning / features 2023-01-14 21:16:29 -08:00
Ross Wightman a2c14c2064 Add tiny/small in12k pretrained and fine-tuned ConvNeXt models 2023-01-11 14:50:39 -08:00
Ross Wightman 2e83bba142 Revert head norm changes to ConvNeXt as it broke some downstream use, alternate workaround for fcmae weights 2023-01-09 13:37:40 -08:00
Ross Wightman e861b74cf8 Pass through --model-kwargs (and --opt-kwargs for train) from command line through to model __init__. Update some models to improve arg overlay. Cleanup along the way. 2023-01-06 16:12:33 -08:00
Ross Wightman 6e5553da5f
Add ConvNeXt-V2 support (model additions and weights) (#1614)
* Add ConvNeXt-V2 support (model additions and weights)

* ConvNeXt-V2 weights on HF Hub, tweaking some tests

* Update README, fixing convnextv2 tests
2023-01-05 07:53:32 -08:00
Ross Wightman 9a51e4ea2e Add FlexiViT models and weights, refactoring, push more weights
* push all vision_transformer*.py weights to HF hub
* finalize more pretrained tags for pushed weights
* refactor pos_embed files and module locations, move some pos embed modules to layers
* tweak hf hub helpers to aid bulk uploading and updating
2022-12-22 17:23:09 -08:00
Ross Wightman 6a01101905 Update efficientnet.py and convnext.py to multi-weight, add ImageNet-12k pretrained EfficientNet-B5 and ConvNeXt-Nano. 2022-12-14 20:33:23 -08: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 755570e2d6 Rename _pretrained.py -> pretrained.py, not feasible to change the other files to same scheme without breaking uses 2022-12-05 10:21:34 -08:00
Ross Wightman 72cfa57761 Add ported Tensorflow MaxVit weights. Add a few more CLIP ViT fine-tunes. Tweak some model tag names. Improve model tag name sorting. Update HF hub push config layout. 2022-12-05 10:21:34 -08:00
Ross Wightman 4d5c395160 MaxVit, ViT, ConvNeXt, and EfficientNet-v2 updates
* Add support for TF weights and modelling specifics to MaxVit (testing ported weights)
* More fine-tuned CLIP ViT configs
* ConvNeXt and MaxVit updated to new pretrained cfgs use
* EfficientNetV2, MaxVit and ConvNeXt high res models use squash crop/resize
2022-12-05 10:21:34 -08:00
Ross Wightman 837c68263b For ConvNeXt, use timm internal LayerNorm for fast_norm in non conv_mlp mode 2022-08-23 15:17:12 -07:00
Ross Wightman 1d8ada359a Add timm ConvNeXt 'atto' weights, change test resolution for FB ConvNeXt 224x224 weights, add support for different dw kernel_size 2022-08-15 17:56:08 -07:00
Ross Wightman 2544d3b80f ConvNeXt pico, femto, and nano, pico, femto ols (overlapping stem) weights and model defs 2022-08-05 17:05:50 -07:00
Ross Wightman 6f103a442b Add convnext_nano weights, 80.8 @ 224, 81.5 @ 288 2022-07-26 16:40:27 -07:00
Ross Wightman c5e0d1c700 Add dilation support to convnext, allows output_stride=8 and 16 use. Fix #1341 2022-07-19 17:52:10 -07:00
Ross Wightman 06307b8b41 Remove experimental downsample in block support in ConvNeXt. Experiment further before keeping it in. 2022-07-07 14:37:58 -07:00
Ross Wightman 188c194b0f Left some experiment stem code in convnext by mistake 2022-07-02 15:17:28 -07:00
Ross Wightman 6064d16a2d Add initial EdgeNeXt import. Significant cleanup / reorg (like ConvNeXt). Fix #1320
* edgenext refactored for torchscript compat, stage base organization
* slight refactor of ConvNeXt to match some EdgeNeXt additions
* remove use of funky LayerNorm layer in ConvNeXt and just use nn.LayerNorm and LayerNorm2d (permute)
2022-07-01 15:18:42 -07:00
SeeFun 8f0bc0591e fix convnext args 2022-04-05 20:00:57 +08:00
SeeFun ec4e9aa5a0
Add ConvNeXt tiny and small pretrain in22k
Add ConvNeXt tiny and small pretrain  in22k from ConvNeXt  repo:
06f7b05f92
2022-03-24 15:18:08 +08:00
Ross Wightman 474ac906a2 Add 'head norm first' convnext_tiny_hnf weights 2022-03-23 16:06:00 -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 5f81d4de23 Move DeiT to own file, vit getting crowded. Working towards fixing #1029, make pooling interface for transformers and mlp closer to convnets. Still working through some details... 2022-01-26 22:53:57 -08:00
Ross Wightman 738a9cd635 unbiased=False for torch.var_mean path of ConvNeXt LN. Fix #1090 2022-01-17 09:25:06 -08:00
Ross Wightman e0c4eec4b6 Default conv_mlp to False across the board for ConvNeXt, causing issues on more setups than it's improving right now... 2022-01-16 14:20:08 -08:00
Ross Wightman b669f4a588 Add ConvNeXt 22k->1k fine-tuned and 384 22k-1k fine-tuned weights after testing 2022-01-15 15:44:36 -08:00
Ross Wightman edd3d73695 Add missing dropout for head reset in ConvNeXt default head 2022-01-14 16:28:27 -08:00
Ross Wightman b093dcb46d Some convnext cleanup, remove in place mul_ for gamma, breaking symbolic trace, cleanup head a bit... 2022-01-14 16:28:27 -08:00
Ross Wightman 18934debc5 Add initial ConvNeXt impl (mods of official code) 2022-01-14 16:28:27 -08:00