bev-project/archive_scripts/EVAL_PHASE3_EPOCH23.sh

69 lines
2.3 KiB
Bash
Executable File
Raw Permalink 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 3 epoch_23.pth性能
# 使用GPU 4-7不影响当前训练GPU 0-3
set -e
export PATH=/opt/conda/bin:$PATH
export LD_LIBRARY_PATH=/opt/conda/lib/python3.8/site-packages/torch/lib:/opt/conda/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=/workspace/bevfusion:$PYTHONPATH
cd /workspace/bevfusion
echo "========================================================================"
echo "Phase 3 Epoch 23 模型评估"
echo "========================================================================"
echo "Checkpoint: runs/enhanced_from_epoch19/epoch_23.pth"
echo "配置: Phase 3 Enhanced BEV Segmentation (400×400)"
echo "GPU: 4-7 (不影响当前训练)"
echo "========================================================================"
echo ""
# 创建评估输出目录
EVAL_DIR="eval_results/phase3_epoch23_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$EVAL_DIR"
echo "评估结果将保存到: $EVAL_DIR"
echo ""
# 使用Phase 3的配置文件进行评估
CONFIG="configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/multitask_enhanced_phase1_HIGHRES.yaml"
CHECKPOINT="runs/enhanced_from_epoch19/epoch_23.pth"
echo "开始评估..."
echo "配置文件: $CONFIG"
echo "Checkpoint: $CHECKPOINT"
echo ""
# 使用GPU 4-7运行评估4张GPU分布式
# 设置CUDA_VISIBLE_DEVICES限制在GPU 4-7
CUDA_VISIBLE_DEVICES=4,5,6,7 \
LD_LIBRARY_PATH=/opt/conda/lib/python3.8/site-packages/torch/lib:/opt/conda/lib:/usr/local/cuda/lib64:$LD_LIBRARY_PATH \
PATH=/opt/conda/bin:$PATH \
/opt/conda/bin/torchpack dist-run -np 4 /opt/conda/bin/python tools/test.py \
"$CONFIG" \
"$CHECKPOINT" \
--eval bbox \
--out "$EVAL_DIR/results.pkl" \
2>&1 | tee "$EVAL_DIR/eval.log"
echo ""
echo "========================================================================"
echo "评估完成!"
echo "========================================================================"
echo "结果文件: $EVAL_DIR/results.pkl"
echo "日志文件: $EVAL_DIR/eval.log"
echo ""
# 提取关键指标
echo "关键性能指标:"
echo "========================================================================"
grep -E "(NDS|mAP|Car|Pedestrian|mIoU)" "$EVAL_DIR/eval.log" | tail -20
echo ""
echo "完整结果请查看: $EVAL_DIR/eval.log"
echo "========================================================================"