diff --git a/egs/wsj/s5/utils/data/get_uniform_subsegments.py b/egs/wsj/s5/utils/data/get_uniform_subsegments.py index a963f35fa70..dfaa55b18f7 100755 --- a/egs/wsj/s5/utils/data/get_uniform_subsegments.py +++ b/egs/wsj/s5/utils/data/get_uniform_subsegments.py @@ -13,11 +13,22 @@ def get_args(): parser = argparse.ArgumentParser( description=textwrap.dedent(""" - Creates a subsegments file from an input segments file - that has the format + Creates a subsegments file from an input segments file. + + The output format is + , - where the timing are relative to the start-time of the - in the input segments file. + + where the timings are relative to the start-time of the + in the input segments file. + Reminder: the format of the input segments file is: + + + + where the recording-id corresponds to a wav file (or a channel of + a wav file) from wav.scp. Note: you can use + utils/data/get_segments_for_data.sh to generate a 'default' + segments file for your data if one doesn't already exist. e.g.: get_uniform_subsegments.py data/dev/segments > \\ data/dev_uniform_segments/sub_segments diff --git a/src/nnet3bin/Makefile b/src/nnet3bin/Makefile index 67d15d3c38a..544109df832 100644 --- a/src/nnet3bin/Makefile +++ b/src/nnet3bin/Makefile @@ -19,7 +19,8 @@ BINFILES = nnet3-init nnet3-info nnet3-get-egs nnet3-copy-egs nnet3-subset-egs \ nnet3-discriminative-subset-egs nnet3-get-egs-simple \ nnet3-discriminative-compute-from-egs nnet3-latgen-faster-looped \ nnet3-egs-augment-image nnet3-xvector-get-egs nnet3-xvector-compute \ - nnet3-latgen-grammar nnet3-compute-batch nnet3-latgen-faster-batch + nnet3-latgen-grammar nnet3-compute-batch nnet3-latgen-faster-batch \ + cuda-gpu-available OBJFILES = @@ -33,6 +34,6 @@ ADDLIBS = ../nnet3/kaldi-nnet3.a ../chain/kaldi-chain.a \ ../lat/kaldi-lat.a ../fstext/kaldi-fstext.a ../hmm/kaldi-hmm.a \ ../transform/kaldi-transform.a ../gmm/kaldi-gmm.a \ ../tree/kaldi-tree.a ../util/kaldi-util.a ../matrix/kaldi-matrix.a \ - ../base/kaldi-base.a + ../base/kaldi-base.a include ../makefiles/default_rules.mk diff --git a/src/nnetbin/cuda-gpu-available.cc b/src/nnet3bin/cuda-gpu-available.cc similarity index 100% rename from src/nnetbin/cuda-gpu-available.cc rename to src/nnet3bin/cuda-gpu-available.cc diff --git a/src/nnetbin/Makefile b/src/nnetbin/Makefile index 86d59ae503e..5e934ff523a 100644 --- a/src/nnetbin/Makefile +++ b/src/nnetbin/Makefile @@ -1,5 +1,9 @@ +# cuda-gpu-available was moved to nnet3bin/; remove it in case an outdated +# version persists. all: + -rm -f cuda-gpu-available + EXTRA_CXXFLAGS = -Wno-sign-compare include ../kaldi.mk @@ -15,7 +19,7 @@ BINFILES = nnet-train-frmshuff \ nnet-forward nnet-copy nnet-info nnet-concat \ transf-to-nnet cmvn-to-nnet nnet-initialize \ feat-to-post paste-post train-transitions \ - cuda-gpu-available nnet-set-learnrate + nnet-set-learnrate OBJFILES = @@ -25,6 +29,6 @@ TESTFILES = ADDLIBS = ../nnet/kaldi-nnet.a ../cudamatrix/kaldi-cudamatrix.a \ ../lat/kaldi-lat.a ../hmm/kaldi-hmm.a ../tree/kaldi-tree.a \ - ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a + ../util/kaldi-util.a ../matrix/kaldi-matrix.a ../base/kaldi-base.a include ../makefiles/default_rules.mk diff --git a/tools/Makefile b/tools/Makefile index e690df3da88..b3a9d88a8ac 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -138,13 +138,9 @@ cub: rm -f cub ln -s cub-$(CUB_VERSION) cub -# OpenBLAS is not compiled by default. Run 'make -j openblas' in this directory to build. +# OpenBLAS is not compiled by default; you can run `make openblas` to build it, +# but you should probably just call extras/install_openblas.sh; this is +# here for legacy reasons. .PHONY: openblas openblas: - @-rm -rf OpenBLAS xianyi-OpenBLAS-* - wget -t3 -nv -O- $$( \ - wget -qO- 'https://api.github.com/repos/xianyi/OpenBLAS/releases/tags/v$(OPENBLAS_VERSION)' | \ - python -c 'import sys,json;print(json.load(sys.stdin)["tarball_url"])') | \ - tar xzf - - mv xianyi-OpenBLAS-* OpenBLAS - $(MAKE) PREFIX=$$(pwd)/OpenBLAS/install USE_THREAD=0 -C OpenBLAS all install + extras/install_openblas.sh diff --git a/tools/extras/install_openblas.sh b/tools/extras/install_openblas.sh index 90afe8e9de4..224a9eade69 100755 --- a/tools/extras/install_openblas.sh +++ b/tools/extras/install_openblas.sh @@ -1,5 +1,25 @@ #!/bin/bash -# OpenBLAS is downloaded and built by tools/Makefile, but not automatically by -# its default 'all' target. -make -j openblas + +OPENBLAS_VERSION=0.3.5 + +set -e + +if ! command -v gfortran 2>/dev/null; then + echo "$0: gfortran is not installed. Please install it, e.g. by:" + echo " apt-get install gfortran" + echo "(if on Debian or Ubuntu), or:" + echo " yum install fortran" + echo "(if on RedHat/CentOS). On a Mac, if brew is installed, it's:" + echo " brew install gfortran" + exit 1 +fi + + +rm -rf xianyi-OpenBLAS-* OpenBLAS + +wget -t3 -nv -O- $(wget -qO- "https://api.github.com/repos/xianyi/OpenBLAS/releases/tags/v${OPENBLAS_VERSION}" | python -c 'import sys,json;print(json.load(sys.stdin)["tarball_url"])') | tar xzf - + +mv xianyi-OpenBLAS-* OpenBLAS + +make PREFIX=$(pwd)/OpenBLAS/install USE_THREAD=0 -C OpenBLAS all install