-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
windows11
python= 3.10.16
torch=2.3.1
funasr= 1.2.0
modelscope=1.25.0
训练模型后没有生成cmvn.json和am.mvn文件是什么原因啊,并且训练的模型是iic/speech_paraformer_asr_nat-zh-cn-16k-common-vocab8404-online,训练后.cache\modelscope\hub\iic里面的这个模型文件夹消失了,生成的cache\modelscope\hub\models\iic文件夹里面多了speech_paraformer_asr_nat-zh-cn-16k-common-vocab8404-online文件夹,且里面模型及配置文件齐全。
使用的训练代码如下(注释了一些原本的代码),结果在output_dir没有找到cmvn.json和am.mvn文件
workspace=pwd
which gpu to train or finetune
export CUDA_VISIBLE_DEVICES="0,1"
gpu_num=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
model_name from model_hub, or model_dir in local path
option 1, download model automatically
model_name_or_model_dir="iic/speech_paraformer_asr_nat-zh-cn-16k-common-vocab8404-online"
option 2, download model by git
#local_path_root=${workspace}/modelscope_models
#mkdir -p ${local_path_root}/${model_name_or_model_dir}
#git clone https://www.modelscope.cn/${model_name_or_model_dir}.git ${local_path_root}/${model_name_or_model_dir}
#model_name_or_model_dir=${local_path_root}/${model_name_or_model_dir}
data dir, which contains: train.json, val.json
data_dir="../../../data/list"
train_data="${data_dir}/train1.jsonl"
val_data="${data_dir}/val.jsonl"
generate train.jsonl and val.jsonl from wav.scp and text.txt
exp output dir
output_dir="./outputs"
log_file="${output_dir}/log.txt"
deepspeed_config=${workspace}/../../ds_stage1.json
mkdir -p ${output_dir}
echo "log_file: ${log_file}"
#torchrun $DISTRIBUTED_ARGS
python ../../../funasr/bin/train_ds.py
++model="C:/Users/Jeff/.cache/modelscope/hub/iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online"
++train_data_set_list="${train_data}"
++valid_data_set_list="${val_data}"
++dataset="AudioDataset"
++dataset_conf.index_ds="IndexDSJsonl"
++dataset_conf.data_split_num=1
++dataset_conf.batch_sampler="BatchSampler"
++dataset_conf.batch_size=6000
++dataset_conf.sort_size=1024
++dataset_conf.batch_type="token"
++dataset_conf.num_workers=4
++train_conf.max_epoch=50
++train_conf.log_interval=1
++train_conf.resume=true
++train_conf.validate_interval=2000
++train_conf.save_checkpoint_interval=2000
++train_conf.keep_nbest_models=20
++train_conf.avg_nbest_model=10
++train_conf.use_deepspeed=false
++train_conf.deepspeed_config=${deepspeed_config}
++optim_conf.lr=0.0002
++output_dir="${output_dir}" &> ${log_file}# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
MIT License (https://opensource.org/licenses/MIT)
workspace=pwd
which gpu to train or finetune
export CUDA_VISIBLE_DEVICES="0,1"
gpu_num=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
model_name from model_hub, or model_dir in local path
option 1, download model automatically
model_name_or_model_dir="iic/speech_paraformer_asr_nat-zh-cn-16k-common-vocab8404-online"
option 2, download model by git
#local_path_root=${workspace}/modelscope_models
#mkdir -p ${local_path_root}/${model_name_or_model_dir}
#git clone https://www.modelscope.cn/${model_name_or_model_dir}.git ${local_path_root}/${model_name_or_model_dir}
#model_name_or_model_dir=${local_path_root}/${model_name_or_model_dir}
data dir, which contains: train.json, val.json
data_dir="../../../data/list"
train_data="${data_dir}/train1.jsonl"
val_data="${data_dir}/val.jsonl"
generate train.jsonl and val.jsonl from wav.scp and text.txt
exp output dir
output_dir="./outputs"
log_file="${output_dir}/log.txt"
deepspeed_config=${workspace}/../../ds_stage1.json
mkdir -p ${output_dir}
echo "log_file: ${log_file}"
#torchrun $DISTRIBUTED_ARGS
python ../../../funasr/bin/train_ds.py
++model="C:/Users/Jeff/.cache/modelscope/hub/iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online"
++train_data_set_list="${train_data}"
++valid_data_set_list="${val_data}"
++dataset="AudioDataset"
++dataset_conf.index_ds="IndexDSJsonl"
++dataset_conf.data_split_num=1
++dataset_conf.batch_sampler="BatchSampler"
++dataset_conf.batch_size=6000
++dataset_conf.sort_size=1024
++dataset_conf.batch_type="token"
++dataset_conf.num_workers=4
++train_conf.max_epoch=50
++train_conf.log_interval=1
++train_conf.resume=true
++train_conf.validate_interval=2000
++train_conf.save_checkpoint_interval=2000
++train_conf.keep_nbest_models=20
++train_conf.avg_nbest_model=10
++train_conf.use_deepspeed=false
++train_conf.deepspeed_config=${deepspeed_config}
++optim_conf.lr=0.0002
++output_dir="${output_dir}" &> ${log_file}