Commit Graph

1521 Commits (832d3618a5f989dbd4f4388842f341c8352e7b0a)

Author SHA1 Message Date
Ross Wightman 27fd2f35d3
Merge pull request #2181 from huggingface/Delaunay-dist-backend
Delaunay dist backend flag
2024-05-15 10:00:59 -07:00
Ross Wightman e57625e814 Tweak dist_backend to use device_type (before possible :) 2024-05-15 08:49:25 -07:00
Ross Wightman 6ca92570f7 Merge branch 'patch-1' of https://github.com/Delaunay/pytorch-image-models into Delaunay-dist-backend 2024-05-15 08:40:58 -07:00
Ross Wightman cd0e7b11ff
Merge pull request #2180 from yvonwin/main
Remove a duplicate function in mobilenetv3.py
2024-05-15 07:54:17 -07:00
Ross Wightman 83aee5c28c Add explicit GAP (avg pool) variants of other SigLIP models. 2024-05-15 07:53:19 -07:00
yvonwin 58f2f79b04 Remove a duplicate function in mobilenetv3.py: `_gen_lcnet` is repeated in mobilenetv3.py.Remove the duplicate code. 2024-05-15 17:59:34 +08:00
Ross Wightman 7b3b11b63f Support loading of paligemma weights into GAP variants of SigLIP ViT. Minor tweak to npz loading for packed transformer weights. 2024-05-14 15:44:37 -07:00
Beckschen df304ffbf2 the dataclass init needs to use the default factory pattern, according to Ross 2024-05-14 15:10:05 -04:00
Ross Wightman cc5f2f6f70 version 1.0.2dev0 2024-05-13 15:25:15 -07:00
Ross Wightman 3bfd036b58 Add normalize flag to transforms factory, allow return of non-normalized native dtype torch.Tensors 2024-05-13 15:23:25 -07:00
Ross Wightman a69863ad61
Merge pull request #2156 from huggingface/hiera
WIP Hiera implementation.
2024-05-13 14:58:12 -07:00
Setepenre 8848dad362
Update distributed.py 2024-05-13 16:55:42 -04:00
Ross Wightman f7aa0a1a71 Add missing vit_wee weight 2024-05-13 12:05:47 -07:00
Ross Wightman 7a4e987b9f Hiera weights on hub 2024-05-13 11:43:22 -07:00
Ross Wightman 23f09af08e Merge branch 'main' into efficientnet_x 2024-05-12 21:31:08 -07:00
Ross Wightman c838c4233f Add typing to reset_classifier() on other models 2024-05-12 11:12:00 -07:00
Ross Wightman 3e03b2bf3f Fix a few more hiera API issues 2024-05-12 11:11:45 -07:00
Ross Wightman 211d18d8ac Move norm & pool into Hiera ClassifierHead. Misc fixes, update features_intermediate() naming 2024-05-11 23:37:35 -07:00
Ross Wightman 2ca45a4ff5 Merge remote-tracking branch 'upstream/main' into hiera 2024-05-11 15:43:05 -07:00
Ross Wightman 1d3ab176bc Remove debug / staging code 2024-05-10 22:16:34 -07:00
Ross Wightman aa4d06a11c sbb vit weights on hub, testing 2024-05-10 17:15:01 -07:00
Ross Wightman 3582ca499e Prepping weight push, benchmarking. 2024-05-10 14:14:06 -07:00
Ross Wightman 2bfa5e5d74 Remove JIT activations, take jit out of ME activations. Remove other instances of torch.jit.script. Breaks torch.compile and is much less performant. Remove SpaceToDepthModule 2024-05-06 16:32:49 -07:00
Beckschen 99d4c7d202 add ViTamin models 2024-05-05 02:50:14 -04:00
Ross Wightman 07535f408a Add AttentionExtract helper module 2024-05-04 14:10:00 -07:00
Ross Wightman 45b7ae8029 forward_intermediates() support for byob/byoanet models 2024-05-04 14:06:52 -07:00
Ross Wightman c4b8897e9e attention -> attn in davit for model consistency 2024-05-04 14:06:11 -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 01dd01b70e forward_intermediates() for MlpMixer models and RegNet. 2024-05-04 10:21:03 -07:00
Ross Wightman f8979d4f50 Comment out time local files while testing new vit weights 2024-05-03 20:26:56 -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 301d0bb21f Stricter check on pool_type for adaptive pooling module. Fix #2159 2024-05-03 16:16:51 -07:00
Ross Wightman d6da4fb01e Add forward_intermediates() to efficientnet / mobilenetv3 based models as an exercise. 2024-05-02 14:19:16 -07:00
Ross Wightman c22efb9765 Add wee & little vits for some experiments 2024-05-02 10:51:35 -07:00
Ross Wightman 67332fce24 Add features_intermediate() support to coatnet, maxvit, swin* models. Refine feature interface. Start prep of new vit weights. 2024-04-30 16:56:33 -07:00
user-miner1 740f4983b3 Assert messages added 2024-04-30 10:10:02 +03:00
Ross Wightman c6db4043cd Update forward_intermediates for hiera to have its own fwd impl w/ early stopping. Remove return_intermediates bool from forward(). Still an fx issue with None mask arg :( 2024-04-29 17:23:37 -07:00
Ross Wightman 9b9a356a04 Add forward_intermediates support for xcit, cait, and volo. 2024-04-29 16:30:45 -07:00
Ross Wightman ef147fd2fb Add forward_intermediates API to Hiera for features_only=True support 2024-04-21 11:30:41 -07:00
Ross Wightman d88bed6535 Bit more Hiera fiddling 2024-04-21 09:36:57 -07:00
Ross Wightman 8a54d2a930 WIP Hiera implementation. Fix #2083. Trying to get image size adaptation to work. 2024-04-20 09:47:17 -07:00
Ross Wightman de15b8b828 Next release will be 1.0 :o 2024-04-11 08:55:27 -07:00
Ross Wightman c8da47a773
Update version.py 2024-04-11 08:45:50 -07:00
Ross Wightman d6b95520f1
Merge pull request #2136 from huggingface/vit_features_only
Exploring vit features_only via new forward_intermediates() API, inspired by #2131
2024-04-11 08:38:20 -07:00
Ross Wightman 24f6d4f7f8 Fix #2127 move to ema device 2024-04-10 21:29:09 -07:00
Ross Wightman 4b2565e4cb More forward_intermediates() / FeatureGetterNet work
* include relpos vit
* refactor reduction / size calcs so hybrid vits work and dynamic_img_size works
* fix -ve feature indices when pruning
* fix mvitv2 w/ class token
* refine naming
* add tests
2024-04-10 15:11:34 -07:00
Ross Wightman ef9c6fb846 forward_head(), consistent pre_logits handling to reduce likelihood of people manually replacing .head module having issues 2024-04-09 21:54:59 -07:00
Ross Wightman 679daef76a More forward_intermediates() & features_only work
* forward_intermediates() added to beit, deit, eva, mvitv2, twins, vit, vit_sam
* add features_only to forward intermediates to allow just intermediate features
* fix #2060
* fix #1374
* fix #657
2024-04-09 21:29:16 -07:00
Ross Wightman c28ee2e904
Merge pull request #2145 from huggingface/fix_imagenet22k_ms_mapping
Add teddy-bear class back to first 1000 classes of imagenet22k_ms_synsets (line 851, index 850)
2024-04-09 14:56:31 -07:00
Ross Wightman f5ea076a46
Merge pull request #2143 from huggingface/fix_asymm_set_grad_enable
Fix #2132, remove use of _C.set_grad_enable. Line endings were messed up too
2024-04-09 10:14:13 -07:00
Ross Wightman 286d941923 Add teddy-bear class back to first 1000 classes of imagenet22k_ms_synsets (index 851) 2024-04-09 09:33:08 -07:00
Ross Wightman 5c5ae8d401 Fix #2132, remove use of _C.set_grad_enable. Line endings were messed up too 2024-04-09 09:00:23 -07:00
Ross Wightman 17b892f703 Fix #2139, disable strict weight loading when head changes from classification 2024-04-09 08:41:37 -07:00
Ross Wightman 5fdc0b4e93 Exploring vit features_only using get_intermediate_layers() as per #2131 2024-04-07 11:24:45 -07:00
fzyzcjy b44e4e45a2 more 2024-04-02 10:25:30 +08:00
fzyzcjy 8880a5cd5c
Update scheduler.py 2024-03-23 11:27:33 +08:00
Ross Wightman 34b41b143c Fiddling with efficientnet x/h defs, is it worth adding & training any? 2024-03-22 17:55:02 -07:00
Ross Wightman c559c3911f Improve vit conversions. OpenAI convert pass through main convert for patch & pos resize. Fix #2120 2024-03-21 10:00:43 -07:00
Ross Wightman 256cf19148 Rename tinyclip models to fit existing 'clip' variants, use consistently mapped OpenCLIP compatible checkpoint on hf hub 2024-03-20 15:21:46 -07:00
Thien Tran 1a1d07d479 add other tinyclip 2024-03-19 07:27:09 +08:00
Thien Tran dfffffac55 add tinyclip 8m 2024-03-19 07:02:17 +08:00
Ross Wightman 6ccb7d6a7c
Merge pull request #2111 from jamesljlster/enhance_vit_get_intermediate_layers
Vision Transformer (ViT) get_intermediate_layers: enhanced to support dynamic image size and saved computational costs from unused blocks
2024-03-18 13:41:18 -07:00
Cheng-Ling Lai db06b56d34
Saved computational costs of get_intermediate_layers() from unused blocks 2024-03-17 21:34:06 +08:00
Cheng-Ling Lai 4731e4efc4
Modified ViT get_intermediate_layers() to support dynamic image size 2024-03-16 23:07:21 +08:00
Ross Wightman ba641e07ae Add support for dynamo based onnx export 2024-03-13 12:05:26 -07:00
SmilingWolf 59cb0be595 SwinV2: add configurable act_layer argument
Defaults to "gelu", but makes it possible to pass "gelu_tanh".
Makes it easier to port weights from JAX/Flax, where the tanh
approximation is the default.
2024-03-05 22:04:17 +01:00
Ross Wightman 49992b0dc7
Update version.py
Update to 0.9.16 for release
2024-02-19 11:08:17 -08:00
Ross Wightman 35d6eef0df Version bump, add test markers back to toml 2024-02-16 09:04:00 -08:00
Ross Wightman 31e0dc0a5d Tweak hgnet before merge 2024-02-12 15:00:32 -08:00
Ross Wightman 3e03491e49 Merge branch 'master' of https://github.com/seefun/pytorch-image-models into seefun-master 2024-02-12 14:59:54 -08:00
Ross Wightman 958938845a
Update version.py 2024-02-10 23:10:50 -08:00
Ross Wightman 47c9bc4dc6 Fix device idx split 2024-02-10 21:41:14 -08:00
Ross Wightman 59239d9df5 Cleanup imports for vit relpos 2024-02-10 21:40:57 -08:00
Ross Wightman ac1b08deb6 fix_init on vit & relpos vit 2024-02-10 20:15:37 -08:00
Ross Wightman 935950cc11 Fix F.sdpa attn drop prob 2024-02-10 20:14:47 -08:00
Ross Wightman 0737cf231d Add Next-ViT 2024-02-10 17:05:16 -08:00
Ross Wightman d6c2cc91af Make NormMlpClassifier head reset args consistent with ClassifierHead 2024-02-10 16:25:33 -08:00
Ross Wightman 87fec3dc14 Update experimental vit model configs 2024-02-10 16:05:58 -08:00
Ross Wightman 7d3c2dc993 Add group_matcher for DaViT 2024-02-10 14:58:45 -08:00
Ross Wightman 7bc7798d0e Type annotation correctness for create_act 2024-02-10 14:57:58 -08:00
Ross Wightman 7d121ac2ef Small tweak of timm ToTensor for clarity 2024-02-10 14:57:40 -08:00
Ross Wightman a08b57e801 Fix distributed flag bug w/ flex device handling 2024-02-03 16:26:15 -08:00
Ross Wightman bee0471f91 forward() pass through for ema model, flag for ema warmup, comment about warmup 2024-02-03 16:24:45 -08:00
Ross Wightman 5e4a4b2adc Merge branch 'device_flex' into mesa_ema 2024-02-02 09:45:30 -08:00
Ross Wightman dd84ef2cd5 ModelEmaV3 and MESA experiments 2024-02-02 09:45:04 -08:00
Ross Wightman d0ff315eed Merge remote-tracking branch 'emav3/faster_ema' into mesa_ema 2024-01-27 14:52:10 -08:00
Ross Wightman 88889de923 Fix meshgrid deprecation warnings and backward compat with explicit 'ndgrid' and 'meshgrid' fn w/o indexing arg 2024-01-27 13:48:33 -08:00
Ross Wightman d4386219c6 Improve type handling for arange & rel pos embeds, keep calculations in float32 until application (may change to apply in float32 in future). Prevent arange type hijacking by DeepSpeed Zero 2024-01-26 16:35:51 -08:00
Ross Wightman 3234daf783 Add missing deprecation mapping for a densenet and xcit model. Fix #2086. Tweak xcit pos embed use of arange for better low prec safety. 2024-01-24 22:04:04 -08:00
Ross Wightman 809a9e14e2 Pass train-crop-mode to create_loader/transforms from train.py args 2024-01-24 16:19:02 -08:00
Ross Wightman a48ab818f5 Improving device flexibility in train. Fix #2081 2024-01-20 15:10:20 -08:00
Li zhuoqun 53a4888328 Add droppath and type hint to Xception. 2024-01-19 11:15:47 -08:00
kalazus 7f19a4cce7 fix fast catavgmax selection 2024-01-16 10:30:08 -08:00
Ross Wightman 2eac2f6955 Fiddling with iterator wrapping for HF ds streaming 2024-01-09 12:41:54 -08:00
Ross Wightman 992976f007
Update version.py 2024-01-08 09:39:22 -08:00
Ross Wightman c50004db79 Allow training w/o validation split set 2024-01-08 09:38:42 -08:00
Ross Wightman be0944edae Significant transforms, dataset, dataloading enhancements. 2024-01-08 09:38:42 -08:00
Ross Wightman b5a4fa9c3b Add pos_weight and support for summing over classes to BCE impl in train scripts 2023-12-30 12:13:06 -08:00
方曦 9dbea3bef6 fix cls head in hgnet 2023-12-27 21:26:26 +08:00
SeeFun 56ae8b906d
fix reset head in hgnet 2023-12-27 20:11:29 +08:00