ViT-PyTorch Implementation

PyTorch
Lightning
Config: Hydra
Template
Paper

Description

Reproduction of Vision Transformer based on this amazing blog post

Todo

  • [ ] Implement Dense Prediction Structure

How to run

Install dependencies

# clone project
git clone https://github.com/gsoykan/ViT-PyTorch-implementation
ViT-PyTorch-implementation

# [OPTIONAL] create conda environment
conda create -n myenv python=3.8
conda activate myenv

# install pytorch according to instructions
# https://pytorch.org/get-started/

# install requirements
pip install -r requirements.txt

Train model with default configuration

# train on CPU
python run.py trainer.gpus=0

# train on GPU
python run.py trainer.gpus=1

Train model with chosen experiment configuration from configs/experiment/

python run.py experiment=experiment_name.yaml

You can override any parameter from command line like this

python run.py trainer.max_epochs=20 datamodule.batch_size=64
GitHub - gsoykan/ViT-PyTorch-implementation at pythonawesome.com
Implementing Vision Transformer (ViT) in PyTorch. Contribute to gsoykan/ViT-PyTorch-implementation development by creating an account on GitHub.