yuekai commited on
Commit
9758015
1 Parent(s): a4f8069

Create convert.sh

Browse files
Files changed (1) hide show
  1. convert.sh +13 -0
convert.sh ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ trtexec=/usr/src/tensorrt/bin/trtexec
2
+ export CUDA_VISIBLE_DEVICES="0"
3
+
4
+ MIN_BATCH=1
5
+ OPT_BATCH=4
6
+ MAX_BATCH=16
7
+ onnx_path=./model_repo_sense_voice_small/encoder/1/model.onnx
8
+ $trtexec --onnx=$onnx_path --saveEngine=model.plan \
9
+ --minShapes=speech:${MIN_BATCH}x8x560,speech_lengths:${MIN_BATCH},language:${MIN_BATCH},textnorm:${MIN_BATCH} \
10
+ --optShapes=speech:${OPT_BATCH}x128x560,speech_lengths:${OPT_BATCH},language:${OPT_BATCH},textnorm:${OPT_BATCH} \
11
+ --maxShapes=speech:${MAX_BATCH}x512x560,speech_lengths:${MAX_BATCH},language:${MAX_BATCH},textnorm:${MAX_BATCH}
12
+ $trtexec --loadEngine=model.plan --noDataTransfers --verbose \
13
+ --shapes=speech:${OPT_BATCH}x65x560,speech_lengths:${OPT_BATCH},language:${OPT_BATCH},textnorm:${OPT_BATCH}