Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ python src/run.py --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.

### Docker

Also, there is 'Dockerfile' in 'image-gpt/Docker' directory. To make a docker-container of the model and use it, you should use the 'build' command to create an image (including dot in the end):

```
docker build -t image-gpt -f docker/Dockerfile .
```

After, you can run it by typing:

```
nvidia-docker run image-gpt
```

### Citation

Please use the following bibtex entry:
Expand Down
26 changes: 26 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
RUN apt-get update && \
apt-get install -y python3-pip && \
pip3 install

# set directory
WORKDIR /image-gpt/

# requirements
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

# copy executive files
COPY ["src/", "download.py", "/src/"]

# download pre-trained model
RUN python3 /src/download.py --model s --ckpt 1000000

# download dataset
RUN python3 /src/download.py --model s --ckpt 1000000 --dataset imagenet

# download color clusters
RUN python3 /src/download.py --model s --ckpt 1000000 --dataset imagenet --clusters

# run iGPT-S
CMD python3 /src/run.py --eval --n_embd 512 --n_head 8 --n_layer 24
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
numpy==1.16.3
tensorflow-gpu==1.13.1
imageio==2.8.0
fire>=0.1.3
regex==2017.4.5
requests==2.21.0
tqdm==4.31.1
tqdm==4.31.1
scipy==1.4.1