124 Star 707 Fork 51

MindSpore/serving

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
export_model.sh 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
徐永飞 提交于 2021-09-01 10:34 . Serving, st check mindir outputs
#!/bin/bash
EXEC_PATH=$(pwd)
export RANK_TABLE_FILE=${EXEC_PATH}/rank_table_8pcs.json
export RANK_SIZE=8
rm -rf device*
for ((i = 1; i < ${RANK_SIZE}; i++)); do
mkdir device$i
cp *.py ./device$i
cd ./device$i
export DEVICE_ID=$i
export RANK_ID=$i
echo "start inference for device $i"
pytest -sv ./distributed_inference.py::test_inference >inference.log$i 2>&1 &
cd ../
done
mkdir device0
cp *.py ./device0
cd ./device0
export DEVICE_ID=0
export RANK_ID=0
echo "start inference for device 0"
pytest -sv ./distributed_inference.py::test_inference >inference.log0 2>&1
if [ $? -eq 0 ]; then
echo "inference success"
else
echo "inference failed"
cat inference.log0
exit 2
fi
cd ../
ls device*/ -l
num=`ls device*/matmul.mindir -l | wc -l`
if [ ${num} -ne 8 ]
then
echo "export matmul mindir failed"
cat device0/inference.log0
exit 2
fi
output_dir=../model
rm -rf ${output_dir}/device*
for ((i = 0; i < ${RANK_SIZE}; i++)); do
mkdir -p ${output_dir}/device${i}
cp device${i}/*.mindir ${output_dir}/device${i}/
cp device${i}/*.pb ${output_dir}/device${i}/
done
echo "copy models success"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/mindspore/serving.git
git@gitee.com:mindspore/serving.git
mindspore
serving
serving
r1.8

搜索帮助