Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NPU TIPC] update python version config of npu tipc #3402

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test_tipc/configs/knet/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ null:null
null:null
##
===========================eval_params===========================
eval:tools/val.py --config test_tipc/configs/knet/knet_resnet50_cityscapes_1024x512_80k --device gpu --num_workers 8
eval:tools/val.py --config test_tipc/configs/knet/knet_resnet50_cityscapes_1024x512_80k.yml --device gpu --num_workers 8
null:null
##
===========================export_params===========================
--save_dir:
--model_path:
norm_export:tools/export.py --config test_tipc/configs/knet/knet_resnet50_cityscapes_1024x512_80k
norm_export:tools/export.py --config test_tipc/configs/knet/knet_resnet50_cityscapes_1024x512_80k.yml
quant_export:null
fpgm_export:null
distill_export:null
export1:null
export2:null
===========================infer_params===========================
infer_model:./test_tipc/output/knet/model.pdparams
infer_export:tools/export.py --config test_tipc/configs/knet/knet_resnet50_cityscapes_1024x512_80k
infer_export:tools/export.py --config test_tipc/configs/knet/knet_resnet50_cityscapes_1024x512_80k.yml
infer_quant:False
inference:deploy/python/infer.py
--device:cpu|gpu
Expand Down
4 changes: 2 additions & 2 deletions test_tipc/configs/segnext/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ null:null
===========================export_params===========================
--save_dir:
--model_path:
norm_export:tools/export.py --config test_tipc/configs/segnext/segnext_mscan_tiny_1024x1024_cityscapes_160k.yml --input_shape 1 3 1024 2048
norm_export:tools/export.py --config test_tipc/configs/segnext/segnext_mscan_t_cityscapes_1024x1024_160k.yml --input_shape 1 3 1024 2048
quant_export:null
fpgm_export:null
distill_export:null
export1:null
export2:null
===========================infer_params===========================
infer_model:./test_tipc/output/segnext/model.pdparams
infer_export:tools/export.py --config test_tipc/configs/segnext/segnext_mscan_tiny_1024x1024_cityscapes_160k.yml --input_shape 1 3 1024 2048
infer_export:tools/export.py --config test_tipc/configs/segnext/segnext_mscan_t_cityscapes_1024x1024_160k.yml --input_shape 1 3 1024 2048
infer_quant:False
inference:deploy/python/infer.py
--device:cpu|gpu
Expand Down
16 changes: 7 additions & 9 deletions test_tipc/test_train_inference_python_npu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,23 @@ fi
# change gpu to npu in tipc txt configs
sed -i "s/Global.use_gpu/Global.use_npu/g" $FILENAME
sed -i "s/--device gpu/--device npu/g" $FILENAME
sed -i "s/--device:gpu/--device:npu/g" $FILENAME
sed -i "s/--device:cpu|gpu/--device:cpu|npu/g" $FILENAME
# disable benchmark as AutoLog required nvidia-smi command
sed -i "s/--benchmark:True/--benchmark:False/g" $FILENAME
# python has been updated to version 3.9 for npu backend
sed -i "s/python3.7/python3.9/g" $FILENAME
dataline=`cat $FILENAME`

# parser params
IFS=$'\n'
lines=(${dataline})
modelname=$(func_parser_value "${lines[1]}")
echo $modelname

if [ $modelname == "hrnet_w48_contrast" ]; then
sed -i "s/lite_train_lite_infer=20/lite_train_lite_infer=10/g" $FILENAME
sed -i "s/--save_interval 500/--save_interval 250/g" $FILENAME
fi

if [ $modelname == "pfpnnet" ]; then
sed -i "s/lite_train_lite_infer=20/lite_train_lite_infer=10/g" $FILENAME
sed -i "s/--save_interval 500/--save_interval 250/g" $FILENAME
if [ $modelname == "hrnet_w48_contrast" ] || [ $modelname == "pfpnnet" ] || [ $modelname == "knet" ] \
|| [ $modelname == "maskformer" ] || [ $modelname == "ocrnet_hrformer_small" ];then
sed -i "s/lite_train_lite_infer=20/lite_train_lite_infer=2/g" $FILENAME
sed -i "s/--save_interval 500/--save_interval 50/g" $FILENAME
fi

# change gpu to npu in execution script
Expand Down