wenet-e2e / wenet

Production First and Production Ready End-to-End Speech Recognition Toolkit
https://wenet-e2e.github.io/wenet/
Apache License 2.0
4.14k stars 1.07k forks source link

Seems that path.sh doesn't contain bin under `libtorch/fc_base/openfst-build` #1553

Closed Randool closed 1 year ago

Randool commented 1 year ago

Cannot find binary files like fstcompile after calling . ./path.sh

I want to build the WFST in stage 7 in aishell/s0 script by calling ./run.sh --stage 7 --stop-stage 7 (previous steps have been completed). But the command reported an error:

tools/fst/compile_lexicon_token_fst.sh:行59: fstcompile:未找到命令
tools/fst/compile_lexicon_token_fst.sh:行60: fstarcsort:未找到命令

However I have followed the Installation(Training and Developing) to build required binary files about fst.

It's seems that the path.sh only contains:

export OPENFST_PREFIX_DIR=${BUILD_DIR}/../fc_base/openfst-subbuild/openfst-populate-prefix

To Reproduce Steps to reproduce the behavior:

  1. Follow the Installation(Training and Developing) to build required binary files.
  2. Go to 'wenet/examples/aishell/s0'.
  3. Call . ./path.sh.
  4. Type fstcompile.

Expected behavior fstcompile cannot be found.

Solution Edit the path.sh to be:

export WENET_DIR=$PWD/../../..
export BUILD_DIR=${WENET_DIR}/runtime/libtorch/build
export OPENFST_PREFIX_DIR=${BUILD_DIR}/../fc_base/openfst-subbuild/openfst-populate-prefix
export OPENFST_BIN=${BUILD_DIR}/../fc_base/openfst-build/src
export PATH=$PWD:${BUILD_DIR}/bin:${BUILD_DIR}/kaldi:${OPENFST_PREFIX_DIR}/bin:${OPENFST_BIN}/bin:$PATH

# NOTE(kan-bayashi): Use UTF-8 in Python to avoid UnicodeDecodeError when LC_ALL=C
export PYTHONIOENCODING=UTF-8
export PYTHONPATH=../../../:$PYTHONPATH
pengzhendong commented 1 year ago

Build the runtime with -DGRAPH_TOOLS=ON before you use it.

Randool commented 1 year ago

Build the runtime with -DGRAPH_TOOLS=ON before you use it.

I have finish the following the commands, while the problem remain.

# runtime build requires cmake 3.14 or above
cd runtime/libtorch
mkdir build && cd build && cmake -DGRAPH_TOOLS=ON .. && cmake --build .

So I manually add ${BUILD_DIR}/../fc_base/openfst-build/src to the PATH.

pengzhendong commented 1 year ago

Plz fix all path.sh and pull request.