yuekai's picture
Create convert.sh
9758015 verified
raw
history blame
772 Bytes
trtexec=/usr/src/tensorrt/bin/trtexec
export CUDA_VISIBLE_DEVICES="0"
MIN_BATCH=1
OPT_BATCH=4
MAX_BATCH=16
onnx_path=./model_repo_sense_voice_small/encoder/1/model.onnx
$trtexec --onnx=$onnx_path --saveEngine=model.plan \
--minShapes=speech:${MIN_BATCH}x8x560,speech_lengths:${MIN_BATCH},language:${MIN_BATCH},textnorm:${MIN_BATCH} \
--optShapes=speech:${OPT_BATCH}x128x560,speech_lengths:${OPT_BATCH},language:${OPT_BATCH},textnorm:${OPT_BATCH} \
--maxShapes=speech:${MAX_BATCH}x512x560,speech_lengths:${MAX_BATCH},language:${MAX_BATCH},textnorm:${MAX_BATCH}
$trtexec --loadEngine=model.plan --noDataTransfers --verbose \
--shapes=speech:${OPT_BATCH}x65x560,speech_lengths:${OPT_BATCH},language:${OPT_BATCH},textnorm:${OPT_BATCH}