提交 94bc5b1f 编写于 作者: D dongshuilong

fix bugs

上级 7d42f2df
little_train
\ No newline at end of file
train/ILSVRC2012_val_00000032.JPEG 573
train/ILSVRC2012_val_00000033.JPEG 150
train/ILSVRC2012_val_00000034.JPEG 981
train/ILSVRC2012_val_00000035.JPEG 586
train/ILSVRC2012_val_00000036.JPEG 887
train/ILSVRC2012_val_00000037.JPEG 32
train/ILSVRC2012_val_00000038.JPEG 398
train/ILSVRC2012_val_00000039.JPEG 777
train/ILSVRC2012_val_00000040.JPEG 74
train/ILSVRC2012_val_00000041.JPEG 516
train/ILSVRC2012_val_00000042.JPEG 756
train/ILSVRC2012_val_00000043.JPEG 129
train/ILSVRC2012_val_00000044.JPEG 198
train/ILSVRC2012_val_00000045.JPEG 256
train/ILSVRC2012_val_00000046.JPEG 725
train/ILSVRC2012_val_00000047.JPEG 565
train/ILSVRC2012_val_00000048.JPEG 167
train/ILSVRC2012_val_00000049.JPEG 717
train/ILSVRC2012_val_00000050.JPEG 394
train/ILSVRC2012_val_00000051.JPEG 92
train/ILSVRC2012_val_00000052.JPEG 29
train/ILSVRC2012_val_00000053.JPEG 844
train/ILSVRC2012_val_00000054.JPEG 591
train/ILSVRC2012_val_00000055.JPEG 358
train/ILSVRC2012_val_00000056.JPEG 468
train/ILSVRC2012_val_00000057.JPEG 259
train/ILSVRC2012_val_00000058.JPEG 994
train/ILSVRC2012_val_00000059.JPEG 872
train/ILSVRC2012_val_00000060.JPEG 588
val/ILSVRC2012_val_00000001.JPEG 65
val/ILSVRC2012_val_00000002.JPEG 970
val/ILSVRC2012_val_00000003.JPEG 230
val/ILSVRC2012_val_00000004.JPEG 809
val/ILSVRC2012_val_00000005.JPEG 516
val/ILSVRC2012_val_00000006.JPEG 57
val/ILSVRC2012_val_00000007.JPEG 334
val/ILSVRC2012_val_00000008.JPEG 415
val/ILSVRC2012_val_00000009.JPEG 674
val/ILSVRC2012_val_00000010.JPEG 332
val/ILSVRC2012_val_00000011.JPEG 109
val/ILSVRC2012_val_00000012.JPEG 286
val/ILSVRC2012_val_00000013.JPEG 370
val/ILSVRC2012_val_00000014.JPEG 757
val/ILSVRC2012_val_00000015.JPEG 595
...@@ -42,7 +42,7 @@ class ClsPredictor(Predictor): ...@@ -42,7 +42,7 @@ class ClsPredictor(Predictor):
self.postprocess = build_postprocess(config["PostProcess"]) self.postprocess = build_postprocess(config["PostProcess"])
# for whole_chain project to test each repo of paddle # for whole_chain project to test each repo of paddle
self.benchmark = config.get(["benchmark"], False) self.benchmark = config.get("benchmark", False)
if self.benchmark: if self.benchmark:
import auto_log import auto_log
import os import os
......
python3.7 python/predict_cls.py -c configs/inference_cls.yaml -o Global.use_gpu=True -o Global.use_tensorrt=False -o Global.use_fp16=False -o Global.inference_model_dir=.././test/output/ResNet50_vd_gpus_0,1/inference -o Global.batch_size=1 -o Global.infer_imgs=.././dataset/chain_dataset/val -o Global.save_log_path=.././test/output/ResNet50_vd_infer_gpu_usetrt_True_precision_False_batchsize_1.log -o benchmark=True
...@@ -6,29 +6,29 @@ model_name_kl:ResNet50_vd|MobileNetV3_large_x1_0 ...@@ -6,29 +6,29 @@ model_name_kl:ResNet50_vd|MobileNetV3_large_x1_0
python:python3.7 python:python3.7
gpu_list:0|0,1|-1 gpu_list:0|0,1|-1
Global.epoch_num:10 Global.epoch_num:10
Global.save_model_dir:./output/ Global.output_dir:./output/
Global.pretrained_model:null Global.pretrained_model:null
Global.save_inference_dir:null Global.save_inference_dir:null
#
#
#
#
#
#
#
#
===========================scripts=========================== ===========================scripts===========================
train:tools/train.py -c test_ci/benchmark.yaml train:tools/train.py -c test/benchmark.yaml
eval:tools/eval.py -c test_ci/benchmark.yaml eval:tools/eval.py -c test/benchmark.yaml
norm_export:tools/export_model.py -c test_ci/benchmark.yaml norm_export:tools/export_model.py -c test/benchmark.yaml
inference:python/predict_cls.py -c configs/inference_cls.yaml inference:python/predict_cls.py -c configs/inference_cls.yaml
#
#
#
#
#
#
#
===========================infer_params=========================== ===========================infer_params===========================
Global.save_log_path:./test/output/ Global.save_log_path:./test/output/
Global.use_gpu:True|False Global.use_gpu:True|False
...@@ -39,13 +39,13 @@ Global.use_tensorrt:True|False ...@@ -39,13 +39,13 @@ Global.use_tensorrt:True|False
Global.use_fp16:True|False Global.use_fp16:True|False
Global.inference_model_dir:./inference Global.inference_model_dir:./inference
Global.infer_imgs:./dataset/chain_dataset/val Global.infer_imgs:./dataset/chain_dataset/val
#
#
#
#
#
#
#
===========================pretrained_model=========================== ===========================pretrained_model===========================
ResNet50_vd:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/legendary_models/ResNet50_vd_pretrained.pdparams ResNet50_vd:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/legendary_models/ResNet50_vd_pretrained.pdparams
ResNeXt101_vd_64x4d:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNeXt101_vd_64x4d_pretrained.pdparams ResNeXt101_vd_64x4d:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/ResNeXt101_vd_64x4d_pretrained.pdparams
......
...@@ -9,9 +9,10 @@ IFS=$'\n' ...@@ -9,9 +9,10 @@ IFS=$'\n'
lines=(${dataline}) lines=(${dataline})
function func_parser_value(){ function func_parser_value(){
strs=$1 strs=$1
ifs=":" IFS=":"
array=(${strs}) array=(${strs})
tmp=${array[1]} IFS="|"
tmp="${array[1]}:${array[2]}"
echo ${tmp} echo ${tmp}
} }
ResNet50_vd=$(func_parser_value "${lines[49]}") ResNet50_vd=$(func_parser_value "${lines[49]}")
...@@ -23,8 +24,6 @@ MobileNetV1=$(func_parser_value "${lines[54]}") ...@@ -23,8 +24,6 @@ MobileNetV1=$(func_parser_value "${lines[54]}")
MobileNetV2=$(func_parser_value "${lines[55]}") MobileNetV2=$(func_parser_value "${lines[55]}")
ShuffleNetV2_x1_0=$(func_parser_value "${lines[56]}") ShuffleNetV2_x1_0=$(func_parser_value "${lines[56]}")
model_name_list=$(func_parser_value "${lines[1]}")
if [ ${MODE} = "lite_train_infer" ] || [ ${MODE} = "whole_infer" ];then if [ ${MODE} = "lite_train_infer" ] || [ ${MODE} = "whole_infer" ];then
# pretrain lite train data # pretrain lite train data
cd dataset cd dataset
...@@ -36,7 +35,7 @@ elif [ ${MODE} = "infer" ];then ...@@ -36,7 +35,7 @@ elif [ ${MODE} = "infer" ];then
# download data # download data
cd dataset cd dataset
wget -nc http://10.21.226.181:8011/dataset/quanliantiao/infer.tar wget -nc http://10.21.226.181:8011/dataset/quanliantiao/infer.tar
tar xf little.tar tar xf infer.tar
ln -s infer chain_dataset ln -s infer chain_dataset
cd ../ cd ../
# download pretrained model # download pretrained model
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
FILENAME=$1 FILENAME=$1
# MODE be one of ['lite_train_infer' 'whole_infer' 'whole_train_infer', 'infer'] # MODE be one of ['lite_train_infer' 'whole_infer' 'whole_train_infer', 'infer']
MODE=$2 MODE=$2
dataline=$(cat ${FILENAME}) dataline=$(cat ${FILENAME})
# parser params # parser params
IFS=$'\n' IFS=$'\n'
lines=(${dataline}) lines=(${dataline})
...@@ -166,21 +164,21 @@ for gpu in ${gpu_list[*]}; do ...@@ -166,21 +164,21 @@ for gpu in ${gpu_list[*]}; do
status_check $? "${cmd}" "${status_log}" status_check $? "${cmd}" "${status_log}"
# run eval # run eval
eval_cmd="${python} ${eval_py} -o Arch.name=${model_name} -o ${pretrain_model_key}=${save_log}/${model_name}/best_model" eval_cmd="${python} ${eval_py} -o Arch.name=${model_name} -o ${pretrain_model_key}=${save_log}/${model_name}/latest"
eval $eval_cmd eval $eval_cmd
status_check $? "${eval_cmd}" "${status_log}" status_check $? "${eval_cmd}" "${status_log}"
# run export model # run export model
save_infer_path="${save_log}" save_infer_path="${save_log}/inference"
export_cmd="${python} ${norm_export} -o Arch.name=${model_name} -o ${pretrain_model_key}=${save_log}/${model_name}/best_model -o ${save_infer_key}=${save_infer_path}" export_cmd="${python} ${norm_export} -o Arch.name=${model_name} -o ${pretrain_model_key}=${save_log}/${model_name}/latest -o ${save_infer_key}=${save_infer_path}"
eval $export_cmd eval $export_cmd
status_check $? "${export_cmd}" "${status_log}" status_check $? "${export_cmd}" "${status_log}"
#run inference #run inference
eval $env eval $env
save_infer_path="${save_log}" save_infer_path="${save_log}/inference"
cd deploy cd deploy
func_inference "${python}" "${inference_py}" "../${save_log}" "../${LOG_PATH}" "../${infer_img_dir}" model_name func_inference "${python}" "${inference_py}" "../${save_infer_path}" "../${LOG_PATH}" "../${infer_img_dir}" "${model_name}"
eval "unset CUDA_VISIBLE_DEVICES" eval "unset CUDA_VISIBLE_DEVICES"
cd .. cd ..
done done
...@@ -203,7 +201,7 @@ else ...@@ -203,7 +201,7 @@ else
#run inference #run inference
cd deploy cd deploy
for model_name in ${model_name_list[*]}; do for model_name in ${model_name_list[*]}; do
func_inference "${python}" "${inference_py}" "../inference_models/${model_name}" "../${LOG_PATH}" "../${infer_img_dir}" func_inference "${python}" "${inference_py}" "../inference_models/${model_name}" "../${LOG_PATH}" "../${infer_img_dir}" "${model_name}"
done done
cd .. cd ..
fi fi
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册