From 60ecf2bc8dd293b29823e911d595c9043b9b087e Mon Sep 17 00:00:00 2001 From: huangjun12 <2399845970@qq.com> Date: Fri, 24 Mar 2023 11:53:46 +0000 Subject: [PATCH] add videoswin benchmark --- .../configs/VideoSwin/train_infer_python.txt | 62 +++++++++++++++++++ test_tipc/prepare.sh | 8 +++ 2 files changed, 70 insertions(+) create mode 100644 test_tipc/configs/VideoSwin/train_infer_python.txt diff --git a/test_tipc/configs/VideoSwin/train_infer_python.txt b/test_tipc/configs/VideoSwin/train_infer_python.txt new file mode 100644 index 000000000..c93e18ce1 --- /dev/null +++ b/test_tipc/configs/VideoSwin/train_infer_python.txt @@ -0,0 +1,62 @@ +===========================train_params=========================== +model_name:VideoSwin +python:python3.7 +gpu_list:0|0,1 +Global.use_gpu:null|null +Global.auto_cast:null +-o epochs:2 +-o output_dir:null +-o DATASET.batch_size:null +-o MODEL.backbone.pretrained:'data/swin_small_patch4_window7_224.pdparams' +train_model_name:null +train_infer_video_dir:null +-o DATASET.train.file_path:'data/k400/train_small_videos.list' -o DATASET.valid.file_path='data/k400/val_small_videos.list' -o DATASET.test.file_path='data/k400/val_small_videos.list' +## +trainer:norm_train +norm_train:main.py --validate -c configs/recognition/videoswin/videoswin_small_k400_videos.yaml --seed 1234 +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:main.py --test -c configs/recognition/videoswin/videoswin_small_k400_videos.yaml +-w:./test_tipc/output/VideoSwin/VideoSwin_epoch_00001.pdparams +## +===========================infer_params=========================== +-o:inference/VideoSwin +-p:null +norm_export:tools/export_model.py -c configs/recognition/videoswin/videoswin_small_k400_videos.yaml --save_name inference +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +inference_dir:null +infer_model:./data/VideoSwin_small_k400.pdparams +infer_export:tools/export_model.py -c configs/recognition/videoswin/videoswin_small_k400_videos.yaml +infer_quant:False +inference:tools/predict.py --config configs/recognition/videoswin/videoswin_small_k400_videos.yaml +--use_gpu:True|False +--enable_mkldnn:False +--cpu_threads:1|6 +--batch_size:1 +--use_tensorrt:False +--precision:fp32|fp16 +--model_file:inference.pdmodel +--input_file:./data/example.avi +null:null +--enable_benchmark:True +--params_file:inference.pdiparams +===========================infer_benchmark_params========================== +random_infer_input:[{float32,[3, 32, 224, 224]}] +===========================train_benchmark_params========================== +batch_size:1 +fp_items:fp32|fp16 +epoch:1 +--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile +flags:FLAGS_conv_workspace_size_limit=800;FLAGS_cudnn_exhaustive_search=1 +max-iters:2000 +===========================to_static_train_benchmark_params=========================== +to_static_train:-o to_static=True \ No newline at end of file diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index 35ee9c0e1..3a2e8af9b 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -467,6 +467,14 @@ if [ ${MODE} = "benchmark_train" ];then wget -nc https://paddlemodels.bj.bcebos.com/video_detection/activitynet_1.3_annotations.json wget -nc https://paddlemodels.bj.bcebos.com/video_detection/activity_net_1_3_new.json popd + elif [ ${model_name} == "VideoSwin" ]; then + # pretrain lite train data + pushd ./data/k400 + wget -nc https://videotag.bj.bcebos.com/Data/k400_videos_small.tar + tar -xf k400_videos_small.tar + popd + # download pretrained weights + wget -nc -P ./data https://videotag.bj.bcebos.com/PaddleVideo-release2.2/swin_small_patch4_window7_224.pdparams --no-check-certificate else echo "Not added into TIPC yet." fi