export.sh 545 字节
Newer Older
1
#!/bin/bash
2

3 4
if [ $# != 4 ];then
    echo "usage: $0 config_path ckpt_prefix jit_model_path model_type"
5 6 7 8 9 10 11 12 13
    exit -1
fi

ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
echo "using $ngpu gpus..."

config_path=$1
ckpt_path_prefix=$2
jit_model_export_path=$3
14
model_type=$4
15 16 17 18 19

python3 -u ${BIN_DIR}/export.py \
--nproc ${ngpu} \
--config ${config_path} \
--checkpoint_path ${ckpt_path_prefix} \
20 21
--export_path ${jit_model_export_path} \
--model_type ${model_type}
22 23 24 25 26 27 28 29

if [ $? -ne 0 ]; then
    echo "Failed in export!"
    exit 1
fi


exit 0