forked from lvapeab/nmt-keras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
197 lines (188 loc) · 8.59 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
sudo: required
dist: trusty
language: python
matrix:
include:
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=PEP8
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=GENERAL
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ENCODINGS
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=GRU DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=LSTM DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ConditionalGRU DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ConditionalLSTM DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=GRU DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=LSTM DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ConditionalGRU DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ConditionalLSTM DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=GRU DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=LSTM DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ConditionalGRU DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=ConditionalLSTM DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=theano TEST_MODE=transformer DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GENERAL
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ENCODINGS
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=shallow
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=deep DIR=bidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=deep DIR=unidir
- python: 2.7
env: KERAS_BACKEND=tensorflow TEST_MODE=transformer DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=GENERAL
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ENCODINGS
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=GRU DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=LSTM DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ConditionalGRU DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ConditionalLSTM DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=GRU DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=LSTM DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ConditionalGRU DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ConditionalLSTM DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=GRU DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=LSTM DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ConditionalGRU DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=ConditionalLSTM DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=theano TEST_MODE=transformer DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=GENERAL
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ENCODINGS
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=shallow
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=deep DIR=bidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=GRU DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=LSTM DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalGRU DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=ConditionalLSTM DEPTH=deep DIR=unidir
- python: 3.6
env: KERAS_BACKEND=tensorflow TEST_MODE=transformer DEPTH=deep DIR=unidir
# command to install dependencies
install:
# code below is taken from http://conda.pydata.org/docs/travis.html
# We do this conditionally because it saves us some downloading if the
# version is the same.
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
# Replace dep1 dep2 ... with your dependencies
- travis_wait 30 conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION --file req-travis-conda.txt
- source activate test-environment
- travis_wait 30 conda install mkl mkl-service
- travis_wait 30 pip install -r req-travis-pip.txt
- export PYTHONPATH=$PWD:$PWD/src:$PYTHONPATH
# set library path
- export LD_LIBRARY_PATH=$HOME/miniconda/envs/test-environment/lib/:$LD_LIBRARY_PATH
# install TensorFlow (CPU version).
- pip install tensorflow
# detect whether core files are changed or not (from Keras)
- export CORE_CHANGED=False;
- export APP_CHANGED=False;
# Install Theano-1.0.4 (for compatibility with numpy>=1.16
- conda install -c conda-forge theano
#install open mpi
# - rm -rf ~/mpi
# - mkdir ~/mpi
# - pushd ~/mpi
# - wget http://cntk.ai/PythonWheel/ForKeras/depends/openmpi_1.10-3.zip
# - unzip ./openmpi_1.10-3.zip
# - sudo dpkg -i openmpi_1.10-3.deb
# - popd
# command to run tests
script:
- export MKL_THREADING_LAYER="GNU"
# run keras backend init to initialize backend config
- python -c "import keras.backend"
- sed -i -e 's/"backend":[[:space:]]*"[^"]*/"backend":\ "'$KERAS_BACKEND'/g' ~/.keras/keras.json;
- echo -e "Running tests with the following config:\n$(cat ~/.keras/keras.json)"
- if [[ "$TEST_MODE" == "PEP8" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH python -m pytest --pep8 -m pep8 -n0;
elif [[ "$TEST_MODE" == "GENERAL" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/test_load_params.py tests/utils/ tests/data_engine/ 2>&1 ;
elif [[ "$TEST_MODE" == "ENCODINGS" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/encodings/ 2>&1 ;
else
if [[ "$DEPTH" == "shallow" ]]; then
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/NMT_architectures/${DEPTH}*_${TEST_MODE}.py 2>&1 ;
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/NMT_architectures/attention_${TEST_MODE}.py 2>&1 ;
else
PYTHONPATH=$PWD:$PYTHONPATH pytest -s tests/NMT_architectures/${DIR}_${DEPTH}*_${TEST_MODE}.py 2>&1 ;
fi
fi