fix dataset pickle problem; using 2.1 paddle; num_workers can > 0; ckpt save in exp dir;fix setup.sh;

pull/578/head
Hui Zhang 4 years ago
parent f2a42bd30f
commit 74cd66634f

@ -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 =

@ -34,6 +34,9 @@ __all__ = [
logger = Log(__name__).getlog() logger = Log(__name__).getlog()
# namedtupe need global for pickle.
TarLocalData = namedtuple('TarLocalData', ['tar2info', 'tar2object'])
class ManifestDataset(Dataset): class ManifestDataset(Dataset):
@classmethod @classmethod
@ -212,9 +215,7 @@ class ManifestDataset(Dataset):
self._rng = np.random.RandomState(random_seed) self._rng = np.random.RandomState(random_seed)
self._keep_transcription_text = keep_transcription_text self._keep_transcription_text = keep_transcription_text
# for caching tar files info # for caching tar files info
self._local_data = namedtuple('local_data', ['tar2info', 'tar2object']) self._local_data = TarLocalData(tar2info={}, tar2object={})
self._local_data.tar2info = {}
self._local_data.tar2object = {}
# read manifest # read manifest
self._manifest = read_manifest( self._manifest = read_manifest(

@ -142,7 +142,7 @@ class ConvolutionModule(nn.Layer):
# GLU mechanism # GLU mechanism
x = self.pointwise_conv1(x) # (batch, 2*channel, dim) 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 # 1D Depthwise Conv
x = self.depthwise_conv(x) x = self.depthwise_conv(x)

@ -1,2 +1,3 @@
# ASR
* s0 for deepspeech2 * s0 for deepspeech2
* s1 for u2 * s1 for u2

@ -1,7 +1,7 @@
#! /usr/bin/env bash #! /usr/bin/env bash
if [ $# != 2 ];then if [ $# != 2 ];then
echo "usage: ${0} ckpt_path avg_num" echo "usage: ${0} ckpt_dir avg_num"
exit -1 exit -1
fi fi

@ -1,7 +1,7 @@
#! /usr/bin/env bash #! /usr/bin/env bash
if [ $# != 1 ];then if [ $# != 1 ];then
echo "usage: ${0} ckpt_path" echo "usage: ${0} ckpt_path_prefix"
exit -1 exit -1
fi fi

@ -5,6 +5,8 @@ if [ $# != 1 ];then
exit -1 exit -1
fi fi
mkdir -p exp
ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}') ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
echo "using $ngpu gpus..." echo "using $ngpu gpus..."
@ -12,8 +14,7 @@ python3 -u ${BIN_DIR}/train.py \
--device 'gpu' \ --device 'gpu' \
--nproc ${ngpu} \ --nproc ${ngpu} \
--config conf/conformer.yaml \ --config conf/conformer.yaml \
--output ckpt-${1} --output exp/${1}
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed in training!" echo "Failed in training!"

@ -10,9 +10,11 @@ fi
if [ -e /etc/lsb-release ];then if [ -e /etc/lsb-release ];then
#${SUDO} apt-get update #${SUDO} apt-get update
${SUDO} apt-get install -y sox pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev ${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." error_msg "Please using Ubuntu or install pkg-config libflac-dev libogg-dev libvorbis-dev libboost-dev swig python3-dev by user."
exit -1 exit -1
fi
fi fi
# install python dependencies # install python dependencies

Loading…
Cancel
Save