Open Vincent-vst opened 2 years ago
sooo, i pretty much spent my entire afternoon trying to make gpt2 work, and I finally manage to make it work.
This is how I did it :
# prerequesite : I have docker installed on my machine
$ docker pull python:3.6
$ docker run -it python:3.6 bash
# at this point, you should be in a docker python3.6 environment
$ git clone https://github.com/openai/gpt-2.git && cd gpt-2
$ pip install -r requirements.txt
$ python3 download_model.py 124M
$ pip install tensorflow==1.13.1 # not 1.12 since it no longer works
# and finally we can execute the script
$ python3 src/interactive_conditional_samples.py --top_k 40
nano DockerFile
FROM python:3.6
RUN git clone https://github.com/openai/gpt-2.git
RUN pip install -r gpt-2/requirements.txt
RUN pip install tensorflow==1.13.1
RUN cd gpt-2 && python3 download_model.py 124M
RUN cd gpt-2 && python3 download_model.py 355M
RUN cd gpt-2 && python3 download_model.py 774M
RUN cd gpt-2 && python3 download_model.py 1558M
RUN git clone https://github.com/nshepperd/gpt-2.git
#python3 src/interactive_conditional_samples.py --top_k 40
docker build --tag openai-gpt2 .
docker run -it -v /root/gpt-2:/opt openai-gpt2 bash -c "cd gpt-2 && python3 src/interactive_conditional_samples.py --top_k 3"
The other examples are a bit overkill. To fix this, all I needed to do was upgrade the Tensorflow version in the default Dockerfile:
FROM tensorflow/tensorflow:1.13.2-gpu-py3
If you are building the cpu Dockerfile, of course use
FROM tensorflow/tensorflow:1.13.2-py3
instead.
the command :
docker build --tag gpt-2 -f Dockerfile.gpu .
return this :