vision_transformer
No description available.
File Explorer
- build.yml
- lit.md
- __init__.py
- augreg.py
- common.py
- inference_time.py
- mixer_base16_cifar10.py
- models.py
- README.md
- vit.py
- __init__.py
- checkpoint.py
- checkpoint_test.py
- inference_time.py
- inference_time_test.py
- input_pipeline.py
- main.py
- models.py
- models_lit.py
- models_mixer.py
- models_resnet.py
- models_test.py
- models_vit.py
- preprocess.py
- preprocess_test.py
- requirements-tpu.txt
- requirements.txt
- test_utils.py
- train.py
- train_test.py
- utils.py
- .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- Python >=3.10
- pip
- JAX / Flax
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.
# Use via CDN
jsDelivrjsDelivr 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 ▼
gcloud compute
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 ▼
gcloud
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 ▼
git clone
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 ▼
pip install
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 ▼
pip3
This command is an alias of `pip`.
tldr pip
View documentation for the original command:
python3
View Details ▼
python3
This command is an alias of `python`.
tldr python
View documentation for the original command:
