提交 c90be853 编写于 作者: H Hui Zhang

to onnx

上级 6477b6f3
...@@ -39,6 +39,9 @@ tools/env.sh ...@@ -39,6 +39,9 @@ tools/env.sh
tools/openfst-1.8.1/ tools/openfst-1.8.1/
tools/libsndfile/ tools/libsndfile/
tools/python-soundfile/ tools/python-soundfile/
tools/onnx
tools/onnxruntime
tools/Paddle2ONNX
speechx/fc_patch/ speechx/fc_patch/
......
#!/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
\ No newline at end of file
此差异已折叠。
...@@ -21,5 +21,5 @@ paddle2onnx --model_dir $dir \ ...@@ -21,5 +21,5 @@ paddle2onnx --model_dir $dir \
--save_file $output \ --save_file $output \
--enable_dev_version True \ --enable_dev_version True \
--opset_version 9 \ --opset_version 9 \
--enable_onnx_checker True \ --enable_onnx_checker True
\ No newline at end of file
...@@ -28,6 +28,7 @@ param=avg_1.jit.pdiparams ...@@ -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 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 if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ];then
# prune model by outputs
mkdir -p $exp/prune mkdir -p $exp/prune
# prune model deps on output_names. # prune model deps on output_names.
...@@ -36,8 +37,8 @@ fi ...@@ -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]}" 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 if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ];then
# infer shape by new shape
mkdir -p $exp/shape mkdir -p $exp/shape
python3 local/pd_infer_shape.py \ python3 local/pd_infer_shape.py \
--model_dir $dir \ --model_dir $dir \
--model_filename $model \ --model_filename $model \
...@@ -47,5 +48,6 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ];then ...@@ -47,5 +48,6 @@ if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ];then
fi fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ];then if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ];then
# to onnx
./local/tonnx.sh $dir $model $param $exp/model.onnx ./local/tonnx.sh $dir $model $param $exp/model.onnx
fi fi
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册