pull/2034/head
Hui Zhang 3 years ago
parent 6477b6f3e6
commit c90be85398

3
.gitignore vendored

@ -39,6 +39,9 @@ tools/env.sh
tools/openfst-1.8.1/
tools/libsndfile/
tools/python-soundfile/
tools/onnx
tools/onnxruntime
tools/Paddle2ONNX
speechx/fc_patch/

@ -0,0 +1,6 @@
#!/bin/bash
git clone https://github.com/onnx/onnx.git
git clone https://github.com/microsoft/onnxruntime.git
git clone https://github.com/PaddlePaddle/Paddle2ONNX.git

File diff suppressed because it is too large Load Diff

@ -21,5 +21,5 @@ paddle2onnx --model_dir $dir \
--save_file $output \
--enable_dev_version True \
--opset_version 9 \
--enable_onnx_checker True \
--enable_onnx_checker True

@ -28,6 +28,7 @@ param=avg_1.jit.pdiparams
output_names=softmax_0.tmp_0,tmp_5,concat_0.tmp_0,concat_1.tmp_0
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ];then
# prune model by outputs
mkdir -p $exp/prune
# prune model deps on output_names.
@ -36,8 +37,8 @@ fi
input_shape_dict="{'audio_chunk':[1,-1,161], 'audio_chunk_lens':[1], 'chunk_state_c_box':[5, 1, 1024], 'chunk_state_h_box':[5,1,1024]}"
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ];then
# infer shape by new shape
mkdir -p $exp/shape
python3 local/pd_infer_shape.py \
--model_dir $dir \
--model_filename $model \
@ -47,5 +48,6 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ];then
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ];then
# to onnx
./local/tonnx.sh $dir $model $param $exp/model.onnx
fi
Loading…
Cancel
Save