Lương Ngọc Huy commited on
Commit
b252db5
·
verified ·
1 Parent(s): 3793f4b

feat(7cam): add matching FOV30 model config

Browse files

Configuration paired with the seven-camera iter-14000 checkpoint.

configs/stream_petr_r50_nucarla_7cam_front_narrow_fov30_finetune.py ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = ["./stream_petr_r50_nucarla_full_90e.py"]
2
+
3
+ # Fine-tune the mature six-view nuCarla model with one extra synchronized,
4
+ # co-located 30-degree front view. The model has no camera-count-specific
5
+ # parameters: view count is inferred from the image and calibration tensors.
6
+ source_data_root = "./data/nucarla_full/"
7
+ seven_camera_info_root = "./data/nucarla_full_7cam_fov30/"
8
+ six_camera_checkpoint = (
9
+ "./work_dirs/stream_petr_r50_nucarla_full_90e/"
10
+ "best_NuCarla_NDS_iter_116650.pth"
11
+ )
12
+
13
+ num_train_samples = 28000
14
+ num_val_samples = 6000
15
+ num_epochs = 15
16
+ num_gpus = 1
17
+
18
+ # Seven views at batch 8 use fewer total image activations than the verified
19
+ # six-view batch 12 run (56 versus 72 views), leaving room for dense frames.
20
+ batch_size = 8
21
+ global_batch_size = num_gpus * batch_size
22
+ num_iters_per_epoch = num_train_samples // global_batch_size
23
+
24
+ data = dict(
25
+ samples_per_gpu=batch_size,
26
+ workers_per_gpu=4,
27
+ train=dict(
28
+ data_root=source_data_root,
29
+ ann_file=(
30
+ seven_camera_info_root
31
+ + "nucarla_full_7cam_fov30_temporal_infos_train.pkl"
32
+ ),
33
+ ),
34
+ val=dict(
35
+ samples_per_gpu=1,
36
+ data_root=source_data_root,
37
+ ann_file=(
38
+ seven_camera_info_root
39
+ + "nucarla_full_7cam_fov30_temporal_infos_val.pkl"
40
+ ),
41
+ ),
42
+ test=dict(
43
+ samples_per_gpu=1,
44
+ data_root=source_data_root,
45
+ ann_file=(
46
+ seven_camera_info_root
47
+ + "nucarla_full_7cam_fov30_temporal_infos_val.pkl"
48
+ ),
49
+ ),
50
+ )
51
+
52
+ # Conservative fine-tuning rate for the already-converged six-camera model.
53
+ optimizer = dict(lr=1.0e-4)
54
+ # ``load_from`` intentionally does not restore optimizer state. Start at the
55
+ # loss scale stored in the mature six-camera checkpoint (512) instead of
56
+ # MMCV's dynamic-scaler default (65,536), which would skip several warm-up
57
+ # steps while backing off from predictable fp16 overflows.
58
+ optimizer_config = dict(
59
+ _delete_=True,
60
+ type="Fp16OptimizerHook",
61
+ loss_scale=dict(
62
+ init_scale=512.0,
63
+ growth_factor=2.0,
64
+ backoff_factor=0.5,
65
+ growth_interval=2000,
66
+ ),
67
+ grad_clip=dict(max_norm=35, norm_type=2),
68
+ )
69
+ lr_config = dict(warmup_iters=500)
70
+ runner = dict(max_iters=num_epochs * num_iters_per_epoch)
71
+ checkpoint_config = dict(interval=num_iters_per_epoch, max_keep_ckpts=10)
72
+ evaluation = dict(
73
+ interval=num_iters_per_epoch,
74
+ save_best="NuCarla_NDS",
75
+ rule="greater",
76
+ )
77
+
78
+ load_from = six_camera_checkpoint
79
+ resume_from = None
80
+ work_dir = "./work_dirs/stream_petr_r50_nucarla_full_7cam_fov30_finetune"