vision_transformer

(★ 12,675)

No description available.

File Explorer

  • .gitignore
  • .style.yapf
  • CONTRIBUTING.md
  • LICENSE
  • lit.ipynb
  • mixer_figure.png
  • README.md
  • setup.py
  • version.py
  • vit_figure.png
  • vit_jax.ipynb
  • vit_jax_augreg.ipynb

# Installation Guide

python
Prerequisites

Setup Steps

git clone https://github.com/google-research/vision_transformer.git

Clone the project source code locally.

pip install -r vit_jax/requirements.txt

Install Python dependency packages for GPU environment.

python -m vit_jax.main --workdir=/tmp/vit --config=vit_jax/configs/vit.py:b16,cifar10 --config.pretrained_dir='gs://vit_models/imagenet21k'

Run fine-tuning using the downloaded model.

Key Commands

pip install -r vit_jax/requirements.txt

Install required Python dependency packages for GPU environment.

python -m vit_jax.main --workdir=/tmp/vit-$(date +%s) --config=$(pwd)/vit_jax/configs/vit.py:b16,cifar10 --config.pretrained_dir='gs://vit_models/imagenet21k'

Execute fine-tuning and training for Vision Transformer and Mixer models.

python3 -m vit_jax.train --help

Print all available flags and help details for training.

If you encounter out-of-memory errors, increase --config.accum_steps or decrease --config.batch.

# Use via CDN

jsDelivr

jsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.

Command Glossary

Commands referenced in this DOCs, explained below.

🔍

gcloud compute

View Details ▼

Create, run, and manage VMs on Google Cloud infrastructure.
See also: `gcloud`.

gcloud compute zones list

List Compute Engine zones:

gcloud compute instances create {{instance_name}}

Create a VM instance:

gcloud compute instances describe {{instance_name}}

Display a VM instance's details:

🔍

gcloud

View Details ▼

The official CLI tool for Google Cloud Platform.
Some subcommands such as `app` and `init` have their own usage documentation.

gcloud config list

List all properties in one's active configuration:

gcloud auth login

Login to a Google account:

gcloud config set project {{project_name}}

Set the active project:

🔍

git clone

View Details ▼

Clone an existing repository.

git clone {{remote_repository_location}} {{path/to/directory}}

Clone an existing repository into a new directory (the default directory is the repository name):

git clone --recursive {{remote_repository_location}}

Clone an existing repository and its submodules:

git clone {{[-n|--no-checkout]}} {{remote_repository_location}}

Clone only the `.git` directory of an existing repository:

🔍

pip install

View Details ▼

Install Python packages.

pip install {{package1 package2 ...}}

Install one or more packages:

pip install {{package1 package2 ...}} {{[-U|--upgrade]}}

Upgrade all specified packages to the latest version, installing any that are not already present:

pip install {{package}}=={{version}}

Install a specific version of a package:

🔍

pip3

View Details ▼

This command is an alias of `pip`.

tldr pip

View documentation for the original command:

🔍

python3

View Details ▼

This command is an alias of `python`.

tldr python

View documentation for the original command:

// repository documentation