diff --git a/.gitconfig b/.gitconfig new file mode 100755 index 000000000..05376061f --- /dev/null +++ b/.gitconfig @@ -0,0 +1,48 @@ +[alias] + st = status + ci = commit + br = branch + co = checkout + df = diff + l = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short + ll = log --stat + +[merge] + tool = vimdiff + +[core] + excludesfile = ~/.gitignore + editor = vim + +[color] + branch = auto + diff = auto + status = auto + +[color "branch"] + current = yellow reverse + local = yellow + remote = green + +[color "diff"] + meta = yellow bold + frag = magenta bold + old = red bold + new = green bold + +[color "status"] + added = yellow + changed = green + untracked = cyan + +[push] + default = matching + +[credential] + helper = store + +[user] + name = + email = + + diff --git a/deepspeech/io/dataset.py b/deepspeech/io/dataset.py index da8b3f502..fba5f7c66 100644 --- a/deepspeech/io/dataset.py +++ b/deepspeech/io/dataset.py @@ -34,6 +34,9 @@ __all__ = [ logger = Log(__name__).getlog() +# namedtupe need global for pickle. +TarLocalData = namedtuple('TarLocalData', ['tar2info', 'tar2object']) + class ManifestDataset(Dataset): @classmethod @@ -212,9 +215,7 @@ class ManifestDataset(Dataset): self._rng = np.random.RandomState(random_seed) self._keep_transcription_text = keep_transcription_text # for caching tar files info - self._local_data = namedtuple('local_data', ['tar2info', 'tar2object']) - self._local_data.tar2info = {} - self._local_data.tar2object = {} + self._local_data = TarLocalData(tar2info={}, tar2object={}) # read manifest self._manifest = read_manifest( diff --git a/deepspeech/modules/conformer_convolution.py b/deepspeech/modules/conformer_convolution.py index b2f194c4a..ec08a34e4 100644 --- a/deepspeech/modules/conformer_convolution.py +++ b/deepspeech/modules/conformer_convolution.py @@ -142,7 +142,7 @@ class ConvolutionModule(nn.Layer): # GLU mechanism x = self.pointwise_conv1(x) # (batch, 2*channel, dim) - x = nn.functional.glu(x, dim=1) # (batch, channel, dim) + x = nn.functional.glu(x, axis=1) # (batch, channel, dim) # 1D Depthwise Conv x = self.depthwise_conv(x) diff --git a/examples/aishell/README.md b/examples/aishell/README.md index 11e022d02..8bb28a26c 100644 --- a/examples/aishell/README.md +++ b/examples/aishell/README.md @@ -1,2 +1,3 @@ +# ASR * s0 for deepspeech2 * s1 for u2 diff --git a/examples/aishell/s1/local/avg.sh b/examples/aishell/s1/local/avg.sh index 17dbd87b1..10bfa769d 100644 --- a/examples/aishell/s1/local/avg.sh +++ b/examples/aishell/s1/local/avg.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash if [ $# != 2 ];then - echo "usage: ${0} ckpt_path avg_num" + echo "usage: ${0} ckpt_dir avg_num" exit -1 fi diff --git a/examples/aishell/s1/local/test.sh b/examples/aishell/s1/local/test.sh index 01aefc63e..dc1ed7174 100644 --- a/examples/aishell/s1/local/test.sh +++ b/examples/aishell/s1/local/test.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash if [ $# != 1 ];then - echo "usage: ${0} ckpt_path" + echo "usage: ${0} ckpt_path_prefix" exit -1 fi diff --git a/examples/aishell/s1/local/train.sh b/examples/aishell/s1/local/train.sh index afa550baa..33f7596d0 100644 --- a/examples/aishell/s1/local/train.sh +++ b/examples/aishell/s1/local/train.sh @@ -5,6 +5,8 @@ if [ $# != 1 ];then exit -1 fi +mkdir -p exp + ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}') echo "using $ngpu gpus..." @@ -12,8 +14,7 @@ python3 -u ${BIN_DIR}/train.py \ --device 'gpu' \ --nproc ${ngpu} \ --config conf/conformer.yaml \ ---output ckpt-${1} - +--output exp/${1} if [ $? -ne 0 ]; then echo "Failed in training!" diff --git a/setup.sh b/setup.sh index 8d82038d9..32d252a04 100644 --- a/setup.sh +++ b/setup.sh @@ -10,9 +10,11 @@ fi if [ -e /etc/lsb-release ];then #${SUDO} apt-get update - ${SUDO} apt-get install -y sox pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev - error_msg "Please using Ubuntu or install pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev by user." - exit -1 + ${SUDO} apt-get install -y vim tig tree sox pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev + if [ $? != 0 ]; then + error_msg "Please using Ubuntu or install pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev by user." + exit -1 + fi fi # install python dependencies