diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index 0378e00ecb548747ca0996bc206b22d498f8b301..730b99f2828a1c59c2ac795487f71f46716ba2a2 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -487,6 +487,9 @@ class Trainer(object): profiler.add_profiler_step(profiler_options) self._compose_callback.on_step_begin(self.status) data['epoch_id'] = epoch_id + if self.cfg.get('to_static', + False) and 'image_file' in data.keys(): + data.pop('image_file') if self.use_amp: if isinstance( diff --git a/test_tipc/benchmark_train.sh b/test_tipc/benchmark_train.sh index bb2324f00c5ecd8eb818f80d969253686f93571f..b4dced75acfbb4d3f470cec798d88477245e29c8 100644 --- a/test_tipc/benchmark_train.sh +++ b/test_tipc/benchmark_train.sh @@ -243,7 +243,7 @@ for batch_size in ${batch_size_list[*]}; do --run_mode ${run_mode} \ --fp_item ${precision} \ --keyword ips: \ - --skip_steps 2 \ + --skip_steps 4 \ --device_num ${device_num} \ --speed_unit images/s \ --convergence_key loss: " @@ -279,7 +279,7 @@ for batch_size in ${batch_size_list[*]}; do --run_mode ${run_mode} \ --fp_item ${precision} \ --keyword ips: \ - --skip_steps 2 \ + --skip_steps 4 \ --device_num ${device_num} \ --speed_unit images/s \ --convergence_key loss: " diff --git a/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt b/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt index a2b9ae5c4a029edb77072bdfd7c8f3038cc31b74..f4b23d2d7ddc141d8bd1f6fc7c7721469ca89ee3 100644 --- a/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/deformable_detr/deformable_detr_r50_1x_coco_train_infer_python.txt @@ -53,6 +53,6 @@ inference:./deploy/python/infer.py batch_size:2 fp_items:fp32|fp16 epoch:1 -repeat:2 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null \ No newline at end of file diff --git a/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt b/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt index 87117a4cc1fa4450a249d8144fd7d038c2901825..ee694fdd7aba7b0363ff54ddd5dc883d9d19c249 100644 --- a/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/dino/dino_r50_4scale_1x_coco_train_infer_python.txt @@ -53,7 +53,7 @@ inference:./deploy/python/infer.py batch_size:2 fp_items:fp32|fp16 epoch:1 -repeat:2 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt b/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt index f95e1a040320a00647682fa585eb87a7590e647a..325148db5f63f47314826b01844a320425220fba 100644 --- a/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/fcos/fcos_r50_fpn_1x_coco_train_infer_python.txt @@ -53,7 +53,7 @@ inference:./deploy/python/infer.py batch_size:2|8 fp_items:fp32|fp16 epoch:1 -repeat:3 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt b/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt index db6d2b00a3bee700e5a3ac9116dae360ece44d67..f03b573c0fb9d5fb6d420216d18a422053764714 100644 --- a/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt +++ b/test_tipc/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco_train_infer_python.txt @@ -53,7 +53,7 @@ inference:./deploy/python/infer.py batch_size:2|4 fp_items:fp32|fp16 epoch:1 -repeat:2 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt b/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt index 57e7e3c3cb9fe36291d05516e4927285f486d13f..cb10d21b34350ee71d07bda6fe86a7f691066327 100644 --- a/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt +++ b/test_tipc/configs/picodet/picodet_s_320_coco_lcnet_train_infer_python.txt @@ -53,7 +53,7 @@ null:null batch_size:64 fp_items:fp32|fp16 epoch:1 -repeat:25 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt b/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt index 19fa1673b0fdd41d050968c3309a6fdcb2853231..8464d70a774f2f11bf800a807f697edc12061f25 100644 --- a/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt +++ b/test_tipc/configs/ppyoloe/ppyoloe_crn_s_300e_coco_train_infer_python.txt @@ -53,8 +53,10 @@ inference:./deploy/python/infer.py batch_size:8 fp_items:fp32|fp16 epoch:1 -repeat:12 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== numpy_infer_input:3x640x640_2.npy +===========================to_static_train_benchmark_params=========================== +to_static_train:--to_static diff --git a/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt b/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt index 7c0b3aa5b8e6dc34f4980fd9bea8d3b59ef82bf6..9b3553e03fd4d9141bf8053e635c6b8f6e1fc9f2 100644 --- a/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt +++ b/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt @@ -53,7 +53,7 @@ null:null batch_size:8 fp_items:fp32|fp16 epoch:1 -repeat:3 +repeat:1 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index 5d3d890f8808fe7218408b451cb1d38e3aa3bec6..989966849e96f6ded137ec37ffe6d5a3ff286dd7 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -99,9 +99,9 @@ elif [ ${MODE} = "benchmark_train" ];then cd ../../ else # prepare lite benchmark coco data - wget -nc -P ./dataset/coco/ https://paddledet.bj.bcebos.com/data/coco_benchmark.tar --no-check-certificate - cd ./dataset/coco/ && tar -xf coco_benchmark.tar - mv -u coco_benchmark/* ./ + wget -nc -P ./dataset/coco/ https://bj.bcebos.com/v1/paddledet/data/cocomini.zip --no-check-certificate + cd ./dataset/coco/ && unzip cocomini.zip + mv -u cocomini/* ./ ls ./ cd ../../ # prepare lite benchmark mot data diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index d5c09ccf09d56a5320abab9611311d930d9b3318..072fb89cf8556a191e7b7e4ef9aa83aa97fb143f 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -311,7 +311,7 @@ else fi # run train train_log_path="${LOG_PATH}/${trainer}_gpus_${gpu}_autocast_${autocast}_nodes_${nodes}.log" - eval "${cmd} > ${train_log_path} 2>&1" + eval "timeout 5m ${cmd} > ${train_log_path} 2>&1" last_status=$? cat ${train_log_path} status_check $last_status "${cmd}" "${status_log}" "${model_name}" "${train_log_path}"