# vit-pytorch

> PyTorch implementations of the Vision Transformer and dozens of its variants

Source: https://talira.ai/catalog/vit-pytorch-8yyrdy8q
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [ai / ml / model libraries](https://talira.ai/categories/ai/ml/model-libraries)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Phil Wang](https://talira.ai/orgs/phil-wang.md)

vit-pytorch is Phil Wang's PyTorch implementation of the Vision Transformer (ViT), which classifies images with a single transformer encoder, together with many of its variants and follow-ups: Simple ViT, NaViT, distillation, Deep ViT, CaiT, Token-to-Token ViT, CCT, Cross ViT, PiT, LeViT, CvT, MaxViT, MobileViT and others, plus masked image modelling for self-supervised pretraining. It installs from PyPI.

## Links

- GitHub: https://github.com/lucidrains/vit-pytorch

## Problems it solves

- train a vision transformer image classifier in PyTorch without writing the architecture myself
- try different vision transformer variants on my image dataset
- pretrain a vision model on unlabelled images with masked image modelling

## Features

- Vision Transformer (ViT) in PyTorch
- many ViT variants (NaViT, CaiT, CvT, MaxViT, MobileViT and more)
- distillation from a convolutional teacher
- masked autoencoder and simple masked image modelling pretraining

## Trust

Overall: 0.60 out of 1.
Signals: maintenance 0.69, adoption 0.88, momentum 0.77, community 0.59, backing 0.30, extensibility 0.00.

- last commit 4 days ago
- 13 commits in the last 90 days
- latest release 1.17.8 9 months ago
- 25.6k GitHub stars
- 29 contributors
- backed by Phil Wang

## Alternatives

- [timm (PyTorch Image Models)](https://talira.ai/catalog/timm-pytorch-image-models-qw7wz34c.md): Large collection of PyTorch image models and backbones with pretrained weights and training scripts
- [Transformers](https://talira.ai/catalog/transformers-fxs828eh.md): Hugging Face's Python library of model definitions for text, vision, audio and multimodal models
- [External-Attention-pytorch](https://talira.ai/catalog/external-attention-pytorch-5fjq684n.md): PyTorch implementations of many attention mechanisms, MLP, re-parameterisation and convolution modules from papers

## Sources

[^1]: https://github.com/lucidrains/vit-pytorch/blob/main/README.md (checked 29 Nov 2026)
[^2]: https://github.com/lucidrains/vit-pytorch/blob/main/LICENSE (checked 29 Nov 2026)
