Alternatives To Image Gpt
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Tensor2tensor13,7018284 months ago79June 21, 2017589apache-2.0Python
Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Cvat10,0862a day ago11July 28, 2023516mitTypeScript
Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
3 years agomitPython
PyTorch implementation of SENet
Image Gpt1,119
3 years ago9otherPython
2 years ago5otherPython
Noise2Noise: Learning Image Restoration without Clean Data - Official TensorFlow implementation of the ICML 2018 paper
2 years ago52otherPython
source code to ICLR'19, 'A Closer Look at Few-shot Classification'
Efficient Pytorch769
2 years ago6Python
My best practice of training large dataset using PyTorch.
Caffenet Benchmark665
6 years ago1Jupyter Notebook
Evaluation of the CNN design choices performance on ImageNet-2012.
3 years ago6apache-2.0Python
A simple method to perform semi-supervised learning with limited data.
2 years ago24otherPython
The original code for the paper "How to train your MAML" along with a replication of the original "Model Agnostic Meta Learning" (MAML) paper in Pytorch.
Alternatives To Image Gpt
Select To Compare

Alternative Project Comparisons

Status: Archive (code is provided as-is, no updates expected)


Code and models from the paper "Generative Pretraining from Pixels".

Supported Platforms:

  • Ubuntu 16.04


You can get miniconda from, or install the dependencies shown below manually.

conda create --name image-gpt python=3.7.3
conda activate image-gpt

conda install numpy=1.16.3
conda install tensorflow-gpu=1.13.1

conda install imageio=2.8.0
conda install requests=2.21.0
conda install tqdm=4.46.0


This repository is meant to be a starting point for researchers and engineers to experiment with image GPT (iGPT). Our code forks GPT-2 to highlight that it can be easily applied across domains. The diff from gpt-2/src/ to image-gpt/src/ includes a new activation function, renaming of several variables, and the introduction of a start-of-sequence token, none of which change the model architecture.

Downloading Pre-trained Models

To download a model checkpoint, run The --model argument should be one of "s", "m", or "l", and the --ckpt argument should be one of "131000", "262000", "524000", or "1000000".

python --model s --ckpt 1000000

This command downloads the iGPT-S checkpoint at 1M training iterations. The default download directory is set to /root/downloads/, and can be changed using the --download_dir argument.

Downloading Datasets

To download datasets, run with the --dataset argument set to "imagenet" or "cifar10".

python --model s --ckpt 1000000 --dataset imagenet

This command additionally downloads 32x32 ImageNet encoded with the 9-bit color palette described in the paper. The datasets we provide are center-cropped images intended for evaluation; random cropped images are required to faithfully replicate training.

Downloading Color Clusters

To download the color cluster file defining our 9-bit color palette, run with the --clusters flag set.

python --model s --ckpt 1000000 --dataset imagenet --clusters

This command additionally downloads the color cluster file. src/ shows how to decode from 9-bit color to RGB and src/ shows how to go the other way around.


Once the desired checkpoint and color cluster file are downloaded, we can run the script in sampling mode. The following commands sample from iGPT-S, iGPT-M, and iGPT-L respectively:

python src/ --sample --n_embd 512  --n_head 8  --n_layer 24
python src/ --sample --n_embd 1024 --n_head 8  --n_layer 36
python src/ --sample --n_embd 1536 --n_head 16 --n_layer 48

If your data is not in /root/downloads/, set --ckpt_path and --color_cluster_path manually. To run on fewer than 8 GPUs, use a command of the following form:

CUDA_VISIBLE_DEVICES=0,1 python src/ --sample --n_embd 512  --n_head 8  --n_layer 24 --n_gpu 2


Once the desired checkpoint and evaluation dataset are downloaded, we can run the script in evaluation mode. The following commands evaluate iGPT-S, iGPT-M, and iGPT-L on ImageNet respectively:

python src/ --eval --n_embd 512  --n_head 8  --n_layer 24
python src/ --eval --n_embd 1024 --n_head 8  --n_layer 36
python src/ --eval --n_embd 1536 --n_head 16 --n_layer 48

If your data is not in /root/downloads/, set --ckpt_path and --data_path manually. You should see that the test generative losses are 2.0895, 2.0614, and 2.0466, matching Figure 3 in the paper.


Please use the following bibtex entry:

  title={Generative Pretraining from Pixels},
  author={Chen, Mark and Radford, Alec and Child, Rewon and Wu, Jeff and Jun, Heewoo and Dhariwal, Prafulla and Luan, David and Sutskever, Ilya},


Modified MIT

Popular Dataset Projects
Popular Imagenet Projects
Popular Data Processing Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.