From 00e109752aefeb951bae6651ccef33a50927ba6a Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 3 Feb 2021 08:05:14 +0000 Subject: [PATCH] update travis to py3 --- .travis.yml | 8 +++++--- .travis/unittest.sh | 2 +- decoders/swig_wrapper.py | 6 ++---- model_utils/network.py | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75c2c135..4ca3f5a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,11 +13,13 @@ addons: apt: packages: - git - - python - - python-pip - - python2.7-dev + - python3 + - python3-pip + - python3-dev before_install: + - python --version + - pip --version - sudo pip install -U virtualenv pre-commit pip - docker pull paddlepaddle/paddle:latest diff --git a/.travis/unittest.sh b/.travis/unittest.sh index f27dc481..e4276436 100755 --- a/.travis/unittest.sh +++ b/.travis/unittest.sh @@ -17,7 +17,7 @@ unittest(){ fi find . -name 'tests' -type d -print0 | \ xargs -0 -I{} -n1 bash -c \ - 'python -m unittest discover -v -s {}' + 'python3 -m unittest discover -v -s {}' cd - > /dev/null } diff --git a/decoders/swig_wrapper.py b/decoders/swig_wrapper.py index 49215722..b32893b9 100644 --- a/decoders/swig_wrapper.py +++ b/decoders/swig_wrapper.py @@ -114,8 +114,6 @@ def ctc_beam_search_decoder_batch(probs_split, batch_beam_results = swig_decoders.ctc_beam_search_decoder_batch( probs_split, vocabulary, beam_size, num_processes, cutoff_prob, cutoff_top_n, ext_scoring_func) - batch_beam_results = [ - [(res[0], res[1]) for res in beam_results] - for beam_results in batch_beam_results - ] + batch_beam_results = [[(res[0], res[1]) for res in beam_results] + for beam_results in batch_beam_results] return batch_beam_results diff --git a/model_utils/network.py b/model_utils/network.py index 6e29eb6e..b8812e60 100644 --- a/model_utils/network.py +++ b/model_utils/network.py @@ -1,4 +1,3 @@ - import collections import paddle.fluid as fluid import numpy as np -- GitLab