Issue compiling DeepSpeech with changes in native_client/ctcdecode/

I changed an output statement in native_client/ctcdecode/native_client/ctcdecode/ctc_beam_search_decoder.cpp, after that I compiled and build the DeepSpeech following the native_client/README.rst. However, the changes are not taking effect and only old statement is printing. What is going wrong?

Note:

  1. native_client/python changes do take effect. Issue only with native_client/ctcdecode

  2. Sequence of steps tried:

  • tensorflow#bazel build --workspace_status_command=“bash native_client/bazel_workspace_status_cmd.sh” --config=monolithic -c opt --copt=-O3 --copt="-D_GLIBCXX_USE_CXX11_ABI=0" --copt=-fvisibility=hidden //native_client:libdeepspeech.so //native_client:generate_trie

  • cd …/DeepSpeech/native_client

  • TFDIR=/home/satish/tensorflow

  • make deepspeech

  • PREFIX=/usr/local sudo make install

  • cd python

  • make bindings

  • pip install dist/deepspeech*

  • cd …/ctcdecode

  • make bindings NUM_PROCESSES=8

  • pip install dist/*.whl

  1. Other thing that I tried: removing bazel-bin/native_client/libdeepspeech.so, make clean in ctcdeocder and make clean in native_client follwed by full building and binding.

  2. Vesions

  • deepspeech version
    TensorFlow: v1.14.0-14-g1aad02a78e
    DeepSpeech: v0.6.0-alpha.5-51-gfcb9bf6

  • cat VERSION
    0.6.0-alpha.5

  1. I need to experiment with ctcdecoder (change top_paths in beam search) - So before that I am just testing the compile and build for ctc decoder changes.

Please help.

Make sure you always do pip install --upgrade (or -U) for development as otherwise pip can skip installing the new package as it’s the same version as the one previously installed.

Where ? During inference or during training ?

During evaluation with ctc_beam_search_decoder_batch.

So, follow @reuben’s suggestion, it’s likely pip might not see the change and you want to enforce. Worst case, make sure you checkout latest version (looks like you have alpha 5, it’s old), and force pip uninstall ds_ctcdecoder before doing the install.

Yes. This helped. One last question:

How to get the pip3 install the decoder from .whl. Right now, pip3 install dist/.whl gives error saying *.whl is not a supported wheel on this platform.

Likely you built with some other version of Python. You need to build with the python version you want to install. Use virtualenv for this.

Latest DeepSpeech/native_client/ctcdecode/Makefile has support for python3. If you have both pip and pip3, In Makefile, modify pip to pip3, python to python3, and then compile and install will work. Hence, Issue is resolved.

Please mark this resolved. Thanks @reuben and @lissyx for prompt reply.

This is not the propey way to do. Setting up a virtualenv is even easier …

1 Like