已合并
Add epoch parameter support for BEVFusion training script. #1973
xiangyuming创建于 4月7日
Add epoch parameter support for BEVFusion training script. #1973
已合并
共 3 个文件变更+5-2
| @@ -152,6 +152,7 @@ cd ../ | |||
| 152 | 运行脚本支持命令行参数(支持默认值+关键字参数+位置参数) | 152 | 运行脚本支持命令行参数(支持默认值+关键字参数+位置参数) |
| 153 | - `--batch-size`:每卡batch size大小,默认值4; | 153 | - `--batch-size`:每卡batch size大小,默认值4; |
| 154 | - `--num-npu`:每节点NPU卡数,默认值8; | 154 | - `--num-npu`:每节点NPU卡数,默认值8; |
| 155 | + - `--epochs`:每节点训练轮数,默认值6; | ||
| 155 | 156 | ||
| 156 | ```shell | 157 | ```shell |
| 157 | # 精度测试拉起脚本,默认训练6个epochs | 158 | # 精度测试拉起脚本,默认训练6个epochs |
| @@ -26,7 +26,7 @@ export SUBM_FP16_ENABLED=1 | |||
| 26 | 26 | ||
| 27 | # 解析参数 | 27 | # 解析参数 |
| 28 | source ${test_path_dir}/parse_args.sh | 28 | source ${test_path_dir}/parse_args.sh |
| 29 | -declare_required_params batch_size num_npu # 接收参数顺序 | 29 | +declare_required_params batch_size num_npu epochs # 接收参数顺序 |
| 30 | parse_common_args "$@" | 30 | parse_common_args "$@" |
| 31 | 31 | ||
| 32 | base_batch_size=$(($batch_size * $num_npu)) | 32 | base_batch_size=$(($batch_size * $num_npu)) |
| @@ -51,6 +51,7 @@ start_time=$(date +%s) | |||
| 51 | bash tools/dist_train.sh \ | 51 | bash tools/dist_train.sh \ |
| 52 | projects/BEVFusion/configs/bevfusion_lidar-cam_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py ${num_npu} \ | 52 | projects/BEVFusion/configs/bevfusion_lidar-cam_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py ${num_npu} \ |
| 53 | --cfg-options train_dataloader.batch_size=${batch_size} auto_scale_lr.base_batch_size=${base_batch_size} \ | 53 | --cfg-options train_dataloader.batch_size=${batch_size} auto_scale_lr.base_batch_size=${base_batch_size} \ |
| 54 | + train_cfg.max_epochs=${epochs}\ | ||
| 54 | load_from=pretrained/bevfusion_lidar_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d-2628f933.pth model.img_backbone.init_cfg.checkpoint=pretrained/swint-nuimages-pretrained.pth --amp \ | 55 | load_from=pretrained/bevfusion_lidar_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d-2628f933.pth model.img_backbone.init_cfg.checkpoint=pretrained/swint-nuimages-pretrained.pth --amp \ |
| 55 | > ${test_path_dir}/output/${log_name} 2>&1 & | 56 | > ${test_path_dir}/output/${log_name} 2>&1 & |
| 56 | 57 | ||
| @@ -19,7 +19,7 @@ fi | |||
| 19 | source ${test_path_dir}/env_npu.sh | 19 | source ${test_path_dir}/env_npu.sh |
| 20 | # 解析参数 | 20 | # 解析参数 |
| 21 | source ${test_path_dir}/parse_args.sh | 21 | source ${test_path_dir}/parse_args.sh |
| 22 | -declare_required_params batch_size num_npu # 接收参数顺序 | 22 | +declare_required_params batch_size num_npu epochs # 接收参数顺序 |
| 23 | parse_common_args "$@" | 23 | parse_common_args "$@" |
| 24 | 24 | ||
| 25 | base_batch_size=$(($batch_size * $num_npu)) | 25 | base_batch_size=$(($batch_size * $num_npu)) |
| @@ -43,6 +43,7 @@ start_time=$(date +%s) | |||
| 43 | bash tools/dist_train.sh \ | 43 | bash tools/dist_train.sh \ |
| 44 | projects/BEVFusion/configs/bevfusion_lidar-cam_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py ${num_npu} \ | 44 | projects/BEVFusion/configs/bevfusion_lidar-cam_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py ${num_npu} \ |
| 45 | --cfg-options train_dataloader.batch_size=${batch_size} auto_scale_lr.base_batch_size=${base_batch_size} \ | 45 | --cfg-options train_dataloader.batch_size=${batch_size} auto_scale_lr.base_batch_size=${base_batch_size} \ |
| 46 | + train_cfg.max_epochs=${epochs}\ | ||
| 46 | load_from=pretrained/bevfusion_lidar_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d-2628f933.pth model.img_backbone.init_cfg.checkpoint=pretrained/swint-nuimages-pretrained.pth \ | 47 | load_from=pretrained/bevfusion_lidar_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d-2628f933.pth model.img_backbone.init_cfg.checkpoint=pretrained/swint-nuimages-pretrained.pth \ |
| 47 | > ${test_path_dir}/output/train_full_${num_npu}p_base_fp32.log 2>&1 & | 48 | > ${test_path_dir}/output/train_full_${num_npu}p_base_fp32.log 2>&1 & |
| 48 | 49 | ||