未验证 提交 cdb617d6 编写于 作者: D duanyanhui 提交者: GitHub

Fix npu tipc to update snapshot_config (#782)

* update tipc scripts for time-consuming model on npu
上级 029edf86
...@@ -24,24 +24,27 @@ sed -i "s/--device:gpu/--device:npu/g" $FILENAME ...@@ -24,24 +24,27 @@ sed -i "s/--device:gpu/--device:npu/g" $FILENAME
sed -i "s/--benchmark:True/--benchmark:False/g" $FILENAME sed -i "s/--benchmark:True/--benchmark:False/g" $FILENAME
dataline=`cat $FILENAME` dataline=`cat $FILENAME`
# parser params
IFS=$'\n'
lines=(${dataline})
# change total iters/epochs for npu/xpu to accelaration # change total iters/epochs for npu/xpu to accelaration
modelname=$(echo $FILENAME | cut -d '/' -f3) modelname=$(func_parser_value "${lines[1]}")
echo $modelname
if [ $modelname == "Pix2pix" ]; then if [ $modelname == "Pix2pix" ]; then
sed -i "s/lite_train_lite_infer=10/lite_train_lite_infer=1/g" $FILENAME sed -i "s/lite_train_lite_infer=10/lite_train_lite_infer=1/g" $FILENAME
sed -i "s/-o log_config.interval=1/-o log_config.interval=1 snapshot_config.interval=1/g" $FILENAME
fi fi
if [ $modelname == "edvr" ]; then if [ $modelname == "edvr" ]; then
sed -i "s/lite_train_lite_infer=100/lite_train_lite_infer=10/g" $FILENAME sed -i "s/lite_train_lite_infer=100/lite_train_lite_infer=10/g" $FILENAME
sed -i "s/snapshot_config.interval=25/snapshot_config.interval=5/g" $FILENAME
fi fi
# change gpu to npu in execution script # change gpu to npu in execution script
sed -i 's/\"gpu\"/\"npu\"/g' test_tipc/test_train_inference_python.sh sed -i 's/\"gpu\"/\"npu\"/g' test_tipc/test_train_inference_python.sh
sed -i 's/--gpus/--npus/g' test_tipc/test_train_inference_python.sh sed -i 's/--gpus/--npus/g' test_tipc/test_train_inference_python.sh
# parser params
IFS=$'\n'
lines=(${dataline})
# pass parameters to test_train_inference_python.sh # pass parameters to test_train_inference_python.sh
cmd="bash test_tipc/test_train_inference_python.sh ${FILENAME} $2" cmd="bash test_tipc/test_train_inference_python.sh ${FILENAME} $2"
echo $cmd echo $cmd
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册