diff --git a/.travis.yml b/.travis.yml index 75c2c1351..4ca3f5a46 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 f27dc481a..e42764368 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 49215722d..b32893b92 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 6e29eb6e4..b8812e609 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