|
| 1 | +#!/bin/sh |
| 2 | +# Copyright 2019 Deepmind Technologies Limited. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | + |
| 17 | +# Get EMNLP data. |
| 18 | +mkdir -p /tmp/emnlp2017 |
| 19 | +curl https://storage.googleapis.com/deepmind-scratchgan-data/train.json --output /tmp/emnlp2017/train.json |
| 20 | +curl https://storage.googleapis.com/deepmind-scratchgan-data/valid.json --output /tmp/emnlp2017/valid.json |
| 21 | +curl https://storage.googleapis.com/deepmind-scratchgan-data/test.json --output /tmp/emnlp2017/test.json |
| 22 | +curl https://storage.googleapis.com/deepmind-scratchgan-data/glove_emnlp2017.txt --output /tmp/emnlp2017/glove_emnlp2017.txt |
| 23 | + |
| 24 | + |
| 25 | +# Install python3.5 |
| 26 | +which python3.5 |
| 27 | +if [ $? -eq 1 ]; then |
| 28 | + echo 'Installing python3.5' |
| 29 | + (cd /usr/src/ |
| 30 | + sudo wget https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tgz |
| 31 | + tar -xvzf Python-3.5.6.tgz |
| 32 | + sudo tar -xvzf Python-3.5.6.tgz |
| 33 | + cd Python-3.5.6 |
| 34 | + ./configure --enable-loadable-sqlite-extensions --enable-optimizations |
| 35 | + sudo make altinstall) |
| 36 | +fi |
| 37 | +# Fail on any error. |
| 38 | +set -e |
| 39 | +python3.5 -m venv scratchgan-venv |
| 40 | +echo 'Created venv' |
| 41 | +source scratchgan-venv/bin/activate |
| 42 | +echo 'Installing pip' |
| 43 | +curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py |
| 44 | +python3.5 get-pip.py pip==20.2.3 |
| 45 | + |
| 46 | + |
| 47 | +echo 'Getting requirements.' |
| 48 | +pip install -r scratchgan/requirements.txt |
| 49 | + |
| 50 | +echo 'Starting training...' |
| 51 | +python3.5 -m scratchgan.experiment --mode="train" & |
| 52 | +python3.5 -m scratchgan.experiment --mode="evaluate_pair" & |
0 commit comments