Skip to content

Temporory hacks for ONNX conversion #5190

Temporory hacks for ONNX conversion

Temporory hacks for ONNX conversion #5190

Workflow file for this run

name: CI
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.7
tf-version:
- 2.3.0
action:
- TEST=TFEngine
- TEST=TFNativeOp
- TEST=TFNetworkLayer
- TEST=TFNetworkRecLayer
- TEST=TFUpdater
- TEST=TFUtil
- TEST=Config
- TEST=Dataset
- TEST=Device
- TEST=EngineTask
- TEST=EngineUtil
- TEST=fork_exec
- TEST=Fsa
- TEST=GeneratingDataset
- TEST=hdf_dump
- TEST=HDFDataset
- TEST=TranslationDataset
- TEST=LearningRateControl
- TEST=Log
- TEST=multi_target
- TEST=NativeOp_chunk
- TEST=NativeOp_sparse
- TEST=NativeOp_subtensor_batched_index
- TEST=Network
- TEST=NetworkBaseLayer
- TEST=NetworkDescription
- TEST=NetworkLayer
- TEST=Pretrain
- TEST=SprintDataset
- TEST=SprintInterface
- TEST=TaskSystem
- TEST=TaskSystem_SharedMem
- TEST=TheanoUtil
- TEST=Util
include:
- action: TEST=TFUtil
python-version: 2.7
tf-version: 1.14.0
- action: TEST=TFUtil
python-version: 3.7
tf-version: 1.15.3
- action: TEST=TFEngine
python-version: 2.7
tf-version: 1.15.0
- action: TEST=TFEngine
python-version: 3.7
tf-version: 1.15.3
- action: TEST=TFNativeOp
python-version: 2.7
tf-version: 1.4.0
- action: TEST=TFNativeOp
python-version: 3.6
tf-version: 1.8.0
- action: TEST=TFNativeOp
python-version: 3.7
tf-version: 1.14.0
- action: TEST=TFNetworkSigProcLayer
python-version: 3.7
tf-version: 1.15.3
- action: TEST=demos
python-version: 3.6
tf-version: 2.3.0
- action: TEST=MultiBatchBeam
python-version: 3.6
tf-version: 2.3.0
- action: TEST=NativeOp
python-version: 3.6
tf-version: 2.3.0
- action: TEST=SprintDataset
python-version: 2.7
tf-version: 1.15.0
- action: TEST=SprintInterface
python-version: 2.7
tf-version: 1.15.0
- action: RUN=tests/pycharm-inspect.py
python-version: 3.7
tf-version: 2.3.0
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 2.7
if: matrix.python-version != 2.7
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.cache
~/.local
key: cache-${{ runner.os }}-py${{ matrix.python-version }}-tf${{ matrix.tf-version }}
restore-keys: |
cache-${{ runner.os }}-py${{ matrix.python-version }}-
- name: Setup dependencies
run: |
echo "PATH=$PATH:~/.local/bin" >> $GITHUB_ENV
echo "Python ${{matrix.python-version}}"
echo "pip: $(type pip)"
echo "pip2: $(type pip2)"
pip2 install -qq --upgrade pip setuptools wheel six | cat # Python2<->Python3
pip2 install --user -r requirements.txt | cat # need for Python2<->Python3 communication tests
pip2 install --user typing | cat
pip install --user --upgrade pip setuptools wheel
pip install --user typing | cat # needed for Python 2 in some cases
if [ "${{matrix.python-version}}" == "2.7" ]; then
echo "Cleaning ub potential messed up tensorboard for Python 2.7."
echo "Current site-packages:"
ls ~/.local/lib/python2.7/site-packages
# https://github.com/tensorflow/tensorboard/issues/1862#issuecomment-521876133
rm -rf ~/.local/lib/python2.7/site-packages/tensorboard* || true
fi
pip install --user -r requirements.txt | cat
pip install --user --upgrade tensorflow==${{ matrix.tf-version }} | cat
pip install --user theano==0.9 | cat
pip install --user nose
# Theano setup.
echo "[global]" >> ~/.theanorc
echo "device = cpu" >> ~/.theanorc
echo "floatX = float32" >> ~/.theanorc
# Enforce the right Python interpreter for nosetests.
echo "#!/usr/bin/env python" > ~/nosetests
cat ~/.local/bin/nosetests >> ~/nosetests
chmod +x ~/nosetests
mv ~/nosetests ~/.local/bin/nosetests
- name: Test Python/Numpy/TF/Theano versions.
run: |
echo "Python env: $(type python) $(python --version)"
python -c "import numpy; print('NumPy:', numpy.version.full_version)"
python -c "import tensorflow as tf; print('TensorFlow:', tf.__git_version__, tf.__version__, tf.__file__)"
python -c "import tensorflow as tf; assert tf.__version__ == '${{ matrix.tf-version }}'"
python -c "import theano; print('Theano:', theano.__version__)"
echo "Nosetests env: $(type nosetests)"
nosetests -V
- name: Cache PyCharm
if: matrix.action == 'RUN=tests/pycharm-inspect.py'
uses: actions/cache@v2
with:
path: |
~/.cache/JetBrains
key: cache-pycharm-${{ runner.os }}-py${{ matrix.python-version }}-tf${{ matrix.tf-version }}
- name: Run test
run: |
export ${{ matrix.action }}
if [[ ! -z "$TEST" ]]; then nosetests tests/test_$TEST.py; fi
if [[ ! -z "$RUN" ]]; then $RUN; fi