Update examples/esc50. (#1203)
parent
3104b23590
commit
1632af7706
@ -0,0 +1,36 @@
|
||||
data:
|
||||
dataset: 'paddleaudio.datasets:ESC50'
|
||||
num_classes: 50
|
||||
train:
|
||||
mode: 'train'
|
||||
split: 1
|
||||
dev:
|
||||
mode: 'dev'
|
||||
split: 1
|
||||
|
||||
model:
|
||||
backbone: 'paddlespeech.cls.models:cnn14'
|
||||
|
||||
feature:
|
||||
sr: 32000
|
||||
n_fft: 1024
|
||||
hop_length: 320
|
||||
window: 'hann'
|
||||
win_length: 1024
|
||||
f_min: 50.0
|
||||
f_max: 14000.0
|
||||
n_mels: 64
|
||||
|
||||
training:
|
||||
epochs: 50
|
||||
learning_rate: 0.00005
|
||||
num_workers: 2
|
||||
batch_size: 16
|
||||
checkpoint_dir: './checkpoint'
|
||||
save_freq: 10
|
||||
log_freq: 10
|
||||
|
||||
predicting:
|
||||
audio_file: '/audio/dog.wav'
|
||||
top_k: 10
|
||||
checkpoint: './checkpoint/epoch_50/model.pdparams'
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
ckpt_dir=$1
|
||||
ckpt=$1
|
||||
output_dir=$2
|
||||
|
||||
python3 ${BIN_DIR}/export_model.py \
|
||||
--checkpoint ${ckpt_dir}/model.pdparams \
|
||||
--checkpoint ${ckpt} \
|
||||
--output_dir ${output_dir}
|
||||
|
@ -1,11 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
audio_file=$1
|
||||
ckpt_dir=$2
|
||||
feat_backend=$3
|
||||
|
||||
python3 ${BIN_DIR}/predict.py \
|
||||
--wav ${audio_file} \
|
||||
--feat_backend ${feat_backend} \
|
||||
--top_k 10 \
|
||||
--checkpoint ${ckpt_dir}/model.pdparams
|
||||
--cfg_path=$1
|
||||
|
@ -1,25 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
ngpu=$1
|
||||
feat_backend=$2
|
||||
|
||||
num_epochs=50
|
||||
batch_size=16
|
||||
ckpt_dir=./checkpoint
|
||||
save_freq=10
|
||||
cfg_path=$2
|
||||
|
||||
if [ ${ngpu} -gt 0 ]; then
|
||||
python3 -m paddle.distributed.launch --gpus $CUDA_VISIBLE_DEVICES ${BIN_DIR}/train.py \
|
||||
--epochs ${num_epochs} \
|
||||
--feat_backend ${feat_backend} \
|
||||
--batch_size ${batch_size} \
|
||||
--checkpoint_dir ${ckpt_dir} \
|
||||
--save_freq ${save_freq}
|
||||
--cfg_path ${cfg_path}
|
||||
else
|
||||
python3 ${BIN_DIR}/train.py \
|
||||
--epochs ${num_epochs} \
|
||||
--feat_backend ${feat_backend} \
|
||||
--batch_size ${batch_size} \
|
||||
--checkpoint_dir ${ckpt_dir} \
|
||||
--save_freq ${save_freq}
|
||||
--cfg_path ${cfg_path}
|
||||
fi
|
||||
|
Loading…
Reference in new issue