huggingface /pytorch-image-models
The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more
★ 37,272⑂ 5,227👁 316⑃ 901● 1,050▤ 81◈ 698
37,272
stars
+4+9+64
5,227
forks
316
watchers
901
prs
1,050
issues
81
releases
698
discussions
README
PyTorch Image Models - What's New - Introduction - Models - Features - Results - Getting Started (Documentation) - Train, Validation, Inference Scripts - Awesome PyTorch Resources - Licenses - Citing What's New November 3, 2026 reset_classifier() and checkpoint reconstruction: fixes across ViT, EVA, BEiT, NaFlexViT, RepViT and iFormer preserve normalization placement and distillation settings when exporting / reloading models after changing the classifier or pooling. Also fix unpooled PiT export and EfficientFormerV2 with distillation disabled. NaFlex: fix ViT / EVA norm placement during conversion, support SwiGLU alignment for DINOv3 / Lingbot checkpoints, and preserve grayscale / non-RGB input channels in data loaders. Fix layer-wise LR decay grouping for RepViT, HGNet, MViTv2 and pre-norm ViTs, and InceptionNeXt feature sizes with output_stride=8/16. Release 1.0.31. October 24, 2026 forward_intermediates() and prune_intermediate_layers() are now supported by every model. Newly added for CSPNet, NFNet, DLA, DenseNet (2870, thanks ghaith-mq), CoaT, ConViT, ConvMixer, CrossViT, HRNet, Inception-v3, Inception-ResNet-v2, NASNet, PNASNet, SelecSLS, SENet, Sequencer2d, VGG, Visformer, Xception and Aligned Xception, with prune_intermediate_layers() for NaFlexViT and MobileNetV5 encoders. CoaT, ConViT, ConvMixer, CrossViT and Visformer gain features_only support. prune_intermediate_layers() fixes prune_head=True removes the whole head (head norm, pre-logits layers, attention pooling) so the pruned model leaves no unused params (DDP w/o find_unused_parameters), except CoaT, CrossViT and HRNet when only some of their parallel scales / branches are taken. Pass prune_head=False to keep it. Pruning a hierarchical model to an earlier stage removes the final norm and head sized for the last stage, forward_features() ends at the last kept feature and num_features / head_hidden_size match it. Pruning to the stem feature removes the stem pooling after it. Fixes for grad checkpointing, stop_early, class token / post network removal, and TorchScript of pruned / feature_cls='getter' models across many families. head_hidden_size is the actual pre-logits (pooled) width in all models, including concat pooling (catavgmax) and after reset_classifier(). Pool types a model can't apply now raise at creation / reset instead of being silently ignored or failing in forward. Other fixes: VOLO num_classes=0 output is the class token embedding (matching forward_head(pre_logits=True)), vit_pe_core reset_classifier() w/ a non map pool removes the attention pool, pool type export via save_for_hf reads the head's current pooling, and headless (num_classes=0) Swin, SwinV2, DaViT and NextViT checkpoints reload correctly. October 13, 2026 Hyperparameter sweeps via a new sweep.py: grid / random search over any train.py argument, one effective --config per job, run on a pool of local GPUs and resumable. WSD sweeps train one stable trunk per hyperparam
Top issues
#1353[FEATURE] Detection models with loss functions and trainers8 comments · 2022-07-17#2628[FEATURE] 3D model support for volumetric / medical imaging in timm7 comments · 2025-12-10#1529[FEATURE] convert model for 1D inputs7 comments · 2022-11-02#2540[FEATURE] Unified `embed` Interfaces for Vision Transformer Models for MIM Pretrain Research5 comments · 2025-07-09#650Video dataset support4 comments · 2021-05-20#2607[FEATURE] [RFC] Support for interchangable attention backends1 comments · 2025-11-08#2056VAE or VQ-VAE is needed1 comments · 2023-12-15#1475[FEATURE] Support variable input size of maxvit and coatnet1 comments · 2022-09-25
Discussions
#2830Would optional whole-block scaling be a useful addition to NaFlexViT?1 comments · 2026-10-03#2731Is NaFlex IterableDataset support available to contribute?1 comments · 2026-08-02#2724Seeking Advice on Hysteroscopy Lesion Classification with Transfer Learning1 comments · 2026-07-20#2667Schedule Free Optimizer1 comments · 2026-02-13#2660Importing VISSL models1 comments · 2026-02-03#2651Why does mobilenetv4_conv_small model training fail to converge?1 comments · 2026-01-20#2646Activation Visualization1 comments · 2026-01-06#2619Training code for resnet34.a1_in1k1 comments · 2025-12-01
Latest release
Release v1.0.31 v1.0.31 2026-11-03November 3, 2026 reset_classifier() and checkpoint reconstruction: fixes across ViT, EVA, BEiT, NaFlexViT, RepViT and iFormer preserve normalization placement and distillation settings when exporting / reloading models after changing the classifier or pooling. Also fix unpooled PiT export and EfficientFormerV2 with distillation disabled. NaFlex: fix ViT / EVA norm placement during conversion, support SwiGLU alignment for DINOv3 / Lingbot checkpoints, and preserve grayscale / non-RGB input channels in data loaders. Fix layer-wise LR decay grouping for RepViT, HGNet, MViTv2 and