Practical overview
When it fits
Use timm when developing in PyTorch and you need a model collection and factory for computer-vision experiments, classification, feature extraction, or training workflows.
Who it is for
- PyTorch developers building image-classification systems.
- Computer-vision practitioners comparing or selecting pretrained architectures.
- Model developers who need feature extractors or configurable output classes.
Documented uses
- List available models and create a selected architecture through timm's model factory.
- Instantiate a pretrained model for a computer-vision workflow.
- Configure a model with a custom number of output classes.
- Turn a supported model into a feature extractor and select output stages.
- Use training components such as Split Batch Normalization in an augmentation-based training setup.
Requirements & limits
- Model creation is organized around timm.create_model() and the registered model names returned by timm.list_models().
- The documented feature-extraction options include features_only and out_indices.
- The documentation's Split Batch Normalization example uses a training script and an image dataset path, with augmentation-split options.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Create a timm feature extractor
Create a model through `timm.create_model` with feature extraction enabled and select output stages.
Before you start
- timm installed and importable in Python
- A model name available to
timm.create_model
Steps
Import
timm.Call
timm.create_modelwith the desired model name andfeatures_only=True.Pass
out_indicesto select the model stages whose features are returned.
Expected outcome
A model configured as a feature extractor, with outputs selected by `out_indices`.
Guide limitations
- The documented default output indices are
(0, 1, 2, 3, 4)whenfeatures_only=Trueis used without specifyingout_indices; the available stage indices depend on the model. - The guide does not document image preprocessing or a forward-pass example.
Train with Split Batch Normalization in timm
Run timm training with augmentation splits and separate Batch Normalization statistics for each split.
Before you start
- The timm
train.pytraining script - The
../imagenette2-320dataset path used in the documented command
Steps
Run the command below.
python train.py ../imagenette2-320 --aug-splits 3 --split-bn --aa rand-m9-mstd0.5-inc1 --resplitUse the resulting three training-batch groups: one original or minimally augmented group and two randomly augmented groups.
During training, Split Batch Normalization uses separate Batch Normalization layers for the groups.
Expected outcome
Training is configured with three augmentation splits and Split Batch Normalization; the first split does not receive random erasing.
Guide limitations
- The training batch size must be evenly divisible by the number of splits.
- The documented example uses three splits; random augmentation makes the second and third groups stochastic.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 November 2026
- Original website title
- Pytorch Image Models (timm) | timmdocs · Official homepage title · retained in its source language

