bev-project/scripts/training/start_phase2.sh

59 lines
1.6 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 启动Phase 2: 添加Dice Loss
# 前提Phase 1 (epoch_23.pth) 已完成
set -e
export PATH=/opt/conda/bin:$PATH
cd /workspace/bevfusion
echo "=========================================="
echo "Phase 2: 添加Dice Loss"
echo "=========================================="
echo ""
echo "增强内容:"
echo " ✅ ASPP (Phase 1)"
echo " ✅ Dice Loss - 改善小目标"
echo " ❌ Deep Supervision (Phase 3)"
echo " ❌ 高权重 (Phase 4)"
echo ""
echo "训练设置:"
echo " 基础模型: epoch_23.pth"
echo " 目标: epoch_26.pth"
echo " 学习率: 5e-5"
echo " 预期提升: mIoU +3-5% (累计)"
echo ""
echo "=========================================="
echo ""
# 查找最新的epoch_23.pth
EPOCH_23_PATH=$(find runs/ -name "epoch_23.pth" -type f | sort -r | head -1)
if [ -z "$EPOCH_23_PATH" ]; then
echo "错误: 找不到epoch_23.pth"
echo "请先完成Phase 1训练"
exit 1
fi
echo "找到Phase 1模型: $EPOCH_23_PATH"
echo ""
echo "开始Phase 2训练..."
echo ""
LOG_FILE="training_phase2_$(date +%Y%m%d_%H%M%S).log"
torchpack dist-run -np 8 python tools/train.py \
configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/multitask_enhanced_phase2.yaml \
--model.encoders.camera.backbone.init_cfg.checkpoint pretrained/swint-nuimages-pretrained.pth \
--load_from "$EPOCH_23_PATH" \
--data.workers_per_gpu 0 \
2>&1 | tee "$LOG_FILE"
echo ""
echo "=========================================="
echo "Phase 2训练完成"
echo "日志: $LOG_FILE"
echo "下一步: 运行 bash scripts/start_phase3.sh"
echo "=========================================="