Commit 7ae0ec76 authored by sunzhq2's avatar sunzhq2 Committed by xuxo
Browse files

update conformer

parent 60a2c57a
espnet: 0.9.0
files:
asr_model_file: exp/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp/valid.acc.ave_10best.pth
lm_file: exp/lm_train_lm_transformer_char_batch_bins2000000/valid.loss.ave_10best.pth
python: "3.7.3 (default, Mar 27 2019, 22:11:17) \n[GCC 7.3.0]"
timestamp: 1603088092.704853
torch: 1.6.0
yaml_files:
asr_train_config: exp/asr_train_asr_conformer3_raw_char_batch_bins4000000_accum_grad4_sp/config.yaml
lm_train_config: exp/lm_train_lm_transformer_char_batch_bins2000000/config.yaml
This diff is collapsed.
python asr_inference_onnx.py \
--onnx_exp /home/sunzhq/workspace/yidong-infer/conformer/onnx_models/transformer_lm \
--test_sets "test" \
--data_dir /data/datasets/0/data_aishell/wav \
# --batch_size 4
# --tag_name transformer_lm
# # 使用量化模型
# python asr_inference_onnx.py --onnx_exp exp/conformer_onnx --use_quantized --batch_size 4
# # 使用GPU加速
# python asr_inference_onnx.py --onnx_exp exp/conformer_onnx --device gpu --inference_nj 8
# - --onnx_exp : ONNX实验目录(必需)
# - --data_dir : 数据目录(默认:./data)
# - --test_sets : 测试集名称(默认:test)
# - --batch_size : 批量大小(默认:1)
# - --device : 推理设备(cpu/gpu,默认:cpu)
# - --inference_nj : 并行任务数(默认:4)
# - --use_quantized : 使用量化模型
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
# 批量转换所有模型
python convert_onnx_batch_size.py \
--input /home/sunzhq/workspace/yidong-infer/conformer/onnx_models/transformer_lm/full \
--output /home/sunzhq/workspace/yidong-infer/conformer/onnx_models_batch24 \
--batch_size 24 \
--batch_mode
\ No newline at end of file
import librosa
import os
sr=16000
audio_dir = "/data/datasets/1/data_aishell/wav/test"
dir_list = os.listdir(audio_dir)
tmp = []
# print(dir_list)
for index in dir_list:
audio_paths = os.listdir(os.path.join(audio_dir,index))
for audio_path in audio_paths:
y, sr = librosa.load(os.path.join(audio_dir,index,audio_path), sr=sr)
if len(y)/sr == 14.6999375:
print(os.path.join(audio_dir,index,audio_path))
tmp.append(len(y)/sr)
# print(sorted(tmp))
# print(audio_paths)
# y, sr = librosa.load(audio_path, sr=16000)
# print(f"音频总长: {len(y)/sr:.2f}秒 ({len(y)}采样点)")
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment