Skip to content

Commit 2bf3b3a

Browse files
authored
Merge pull request #1450 from yt605155624/pwgan_tipc
[TIPC]add pwgan tipc
2 parents 4de48ca + 5fb7145 commit 2bf3b3a

File tree

5 files changed

+210
-81
lines changed

5 files changed

+210
-81
lines changed

tests/test_tipc/common_func.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
function func_parser_key(){
4+
strs=$1
5+
IFS=":"
6+
array=(${strs})
7+
tmp=${array[0]}
8+
echo ${tmp}
9+
}
10+
11+
function func_parser_value(){
12+
strs=$1
13+
IFS=":"
14+
array=(${strs})
15+
tmp=${array[1]}
16+
echo ${tmp}
17+
}
18+
19+
function func_set_params(){
20+
key=$1
21+
value=$2
22+
if [ ${key}x = "null"x ];then
23+
echo " "
24+
elif [[ ${value} = "null" ]] || [[ ${value} = " " ]] || [ ${#value} -le 0 ];then
25+
echo " "
26+
else
27+
echo "${key}=${value}"
28+
fi
29+
}
30+
31+
function func_parser_params(){
32+
strs=$1
33+
MODE=$2
34+
IFS=":"
35+
array=(${strs})
36+
key=${array[0]}
37+
tmp=${array[1]}
38+
IFS="|"
39+
res=""
40+
for _params in ${tmp[*]}; do
41+
IFS="="
42+
array=(${_params})
43+
mode=${array[0]}
44+
value=${array[1]}
45+
if [[ ${mode} = ${MODE} ]]; then
46+
IFS="|"
47+
#echo $(func_set_params "${mode}" "${value}")
48+
echo $value
49+
break
50+
fi
51+
IFS="|"
52+
done
53+
echo ${res}
54+
}
55+
56+
function status_check(){
57+
last_status=$1 # the exit code
58+
run_command=$2
59+
run_log=$3
60+
if [ $last_status -eq 0 ]; then
61+
echo -e "\033[33m Run successfully with command - ${run_command}! \033[0m" | tee -a ${run_log}
62+
else
63+
echo -e "\033[33m Run failed with command - ${run_command}! \033[0m" | tee -a ${run_log}
64+
fi
65+
}

tests/test_tipc/configs/conformer/train_benchmark.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ batch_size:16|30
5454
fp_items:fp32
5555
iteration:50
5656
--profiler-options:"batch_range=[10,35];state=GPU;tracer_option=Default;profile_path=model.profile"
57-
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096"
57+
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
===========================train_params===========================
2+
model_name:pwgan
3+
python:python3.7
4+
gpu_list:0|0,1
5+
null:null
6+
null:null
7+
--max-iter:100
8+
null:null
9+
--batch-size:6
10+
null:null
11+
null:null
12+
null:null
13+
null:null
14+
##
15+
trainer:norm_train
16+
norm_train: ../paddlespeech/t2s/exps/gan_vocoder/parallelwave_gan/train.py --ngpu=1 --train-metadata=dump/train/norm/metadata.jsonl --dev-metadata=dump/dev/norm/metadata.jsonl --config=../examples/csmsc/voc1/conf/default.yaml --output-dir=exp/default --run-benchmark=true --max-iter 10
17+
pact_train:null
18+
fpgm_train:null
19+
distill_train:null
20+
null:null
21+
null:null
22+
##
23+
===========================eval_params===========================
24+
eval:null
25+
null:null
26+
##
27+
===========================infer_params===========================
28+
null:null
29+
null:null
30+
norm_export: null
31+
quant_export:null
32+
fpgm_export:null
33+
distill_export:null
34+
export1:null
35+
export2:null
36+
null:null
37+
infer_model:null
38+
infer_export:null
39+
infer_quant:null
40+
inference:null
41+
null:null
42+
null:null
43+
null:null
44+
null:null
45+
null:null
46+
null:null
47+
null:null
48+
null:null
49+
null:null
50+
null:null
51+
null:null
52+
===========================train_benchmark_params==========================
53+
batch_size:6|16
54+
fp_items:fp32
55+
iteration:50
56+
--profiler_options:"batch_range=[10,35];state=GPU;tracer_option=Default;profile_path=model.profile"
57+
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096

tests/test_tipc/prepare.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,19 @@ if [ ${MODE} = "benchmark_train" ];then
5858
sed -i "s#data/#test_tipc/conformer/benchmark_train/data/#g" ${curPath}/conformer/benchmark_train/conf/preprocess.yaml
5959

6060
fi
61-
fi
61+
62+
if [ ${model_name} == "pwgan" ]; then
63+
# 下载 csmsc 数据集并解压缩
64+
wget -nc https://weixinxcxdb.oss-cn-beijing.aliyuncs.com/gwYinPinKu/BZNSYP.rar
65+
mkdir -p BZNSYP
66+
unrar x BZNSYP.rar BZNSYP
67+
wget -nc https://paddlespeech.bj.bcebos.com/Parakeet/benchmark/durations.txt
68+
# 数据预处理
69+
python ../paddlespeech/t2s/exps/gan_vocoder/preprocess.py --rootdir=BZNSYP/ --dumpdir=dump --num-cpu=20 --cut-sil=True --dur-file=durations.txt --config=../examples/csmsc/voc1/conf/default.yaml
70+
python ../utils/compute_statistics.py --metadata=dump/train/raw/metadata.jsonl --field-name="feats"
71+
python ../paddlespeech/t2s/exps/gan_vocoder/normalize.py --metadata=dump/train/raw/metadata.jsonl --dumpdir=dump/train/norm --stats=dump/train/feats_stats.npy
72+
python ../paddlespeech/t2s/exps/gan_vocoder/normalize.py --metadata=dump/dev/raw/metadata.jsonl --dumpdir=dump/dev/norm --stats=dump/train/feats_stats.npy
73+
python ../paddlespeech/t2s/exps/gan_vocoder/normalize.py --metadata=dump/test/raw/metadata.jsonl --dumpdir=dump/test/norm --stats=dump/train/feats_stats.npy
74+
fi
75+
76+
fi

0 commit comments

Comments
 (0)