[Bug] Using pre trained weights from BEVFusion, the overall bbox of the test results shifted upward by half
Prerequisite
- I have searched Issues and Discussions but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version (dev-1.x) or latest version (dev-1.0).
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
1.x branch https://github.com/open-mmlab/mmdetection3d/tree/dev-1.x
Environment
sys.platform: linux Python: 3.8.20 (default, Oct 3 2024, 15:24:27) [GCC 11.2.0] CUDA available: True MUSA available: False numpy_random_seed: 905639012 GPU 0,1,2: NVIDIA RTX A6000 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 12.4, V12.4.131 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 PyTorch: 2.4.1 PyTorch compiling details: PyTorch built with:
GCC 9.3
C++ Version: 201703
Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
Intel(R) MKL-DNN v3.4.2 (Git Hash 1137e04ec0b5251ca2b4400a4fd3c667ce843d67)
OpenMP 201511 (a.k.a. OpenMP 4.5)
LAPACK is enabled (usually provided by MKL)
NNPACK is enabled
CPU capability usage: AVX512
CUDA Runtime 12.4
NVCC architecture flags: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_90,code=sm_90
CuDNN 90.1
Magma 2.6.1
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=12.4, CUDNN_VERSION=9.1.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=2.4.1, USE_CUDA=ON, USE_CUDNN=ON, USE_CUSPARSELT=1, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF,
TorchVision: 0.20.0 OpenCV: 4.11.0 MMEngine: 0.10.7
Reproduces the problem - code sample
.
Reproduces the problem - command or script
BEVFusion python tools/test.py projects/BEVFusion/configs/bevfusion_lidar-cam_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py /4T/home/fh/fenghao/VS_Code_projects/mmdetection3d_0/checkpoints/bevfusion_converted.pth --work-dir /4T/home/fh/fenghao/VS_Code_projects/mmdetection3d/A_output/BEVFusion/test/eval_metrics --show-dir /4T/home/fh/fenghao/VS_Code_projects/mmdetection3d/A_output/BEVFusion/test/results --task multi-modality_det
Reproduces the problem - error message
Using pre trained weights from BEVFusion, the overall bbox of the test results shifted upward by half. Why is this?
https://sm.ms/image/FBehHsNKJEWviGf
Additional information
Here is my test log: 2025/04/11 15:06:09 - mmengine - INFO -
System environment: sys.platform: linux Python: 3.8.20 (default, Oct 3 2024, 15:24:27) [GCC 11.2.0] CUDA available: True MUSA available: False numpy_random_seed: 905639012 GPU 0,1,2: NVIDIA RTX A6000 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 12.4, V12.4.131 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 PyTorch: 2.4.1 PyTorch compiling details: PyTorch built with:
GCC 9.3
C++ Version: 201703
Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
Intel(R) MKL-DNN v3.4.2 (Git Hash 1137e04ec0b5251ca2b4400a4fd3c667ce843d67)
OpenMP 201511 (a.k.a. OpenMP 4.5)
LAPACK is enabled (usually provided by MKL)
NNPACK is enabled
CPU capability usage: AVX512
CUDA Runtime 12.4
NVCC architecture flags: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_90,code=sm_90
CuDNN 90.1
Magma 2.6.1
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=12.4, CUDNN_VERSION=9.1.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=2.4.1, USE_CUDA=ON, USE_CUDNN=ON, USE_CUSPARSELT=1, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_GLOO=ON, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF,
TorchVision: 0.20.0 OpenCV: 4.11.0 MMEngine: 0.10.7
Runtime environment: cudnn_benchmark: False mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0} dist_cfg: {'backend': 'nccl'} seed: 905639012 Distributed launcher: none Distributed training: False GPU number: 1
2025/04/11 15:06:12 - mmengine - INFO - Config: auto_scale_lr = dict(base_batch_size=32, enable=False) backend_args = None class_names = [ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone', ] custom_imports = dict( allow_failed_imports=False, imports=[ 'projects.BEVFusion.bevfusion', ]) data_prefix = dict( CAM_BACK='samples/CAM_BACK', CAM_BACK_LEFT='samples/CAM_BACK_LEFT', CAM_BACK_RIGHT='samples/CAM_BACK_RIGHT', CAM_FRONT='samples/CAM_FRONT', CAM_FRONT_LEFT='samples/CAM_FRONT_LEFT', CAM_FRONT_RIGHT='samples/CAM_FRONT_RIGHT', pts='samples/LIDAR_TOP', sweeps='sweeps/LIDAR_TOP') data_root = '/4T/home/fh/fenghao/VS_Code_projects/mmdetection3d_0/data/nuscenes/' dataset_type = 'NuScenesDataset' db_sampler = dict( classes=[ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone', ], data_root= '/4T/home/fh/fenghao/VS_Code_projects/mmdetection3d_0/data/nuscenes/', info_path= '/4T/home/fh/fenghao/VS_Code_projects/mmdetection3d_0/data/nuscenes/nuscenes_dbinfos_train.pkl', points_loader=dict( backend_args=None, coord_type='LIDAR', load_dim=5, type='LoadPointsFromFile', use_dim=[ 0, 1, 2, 3, 4, ]), prepare=dict( filter_by_difficulty=[ -1, ], filter_by_min_points=dict( barrier=5, bicycle=5, bus=5, car=5, construction_vehicle=5, motorcycle=5, pedestrian=5, traffic_cone=5, trailer=5, truck=5)), rate=1.0, sample_groups=dict( barrier=2, bicycle=6, bus=4, car=2, construction_vehicle=7, motorcycle=6, pedestrian=2, traffic_cone=2, trailer=6, truck=3)) default_hooks = dict( checkpoint=dict(interval=1, type='CheckpointHook'), logger=dict(interval=50, type='LoggerHook'), param_scheduler=dict(type='ParamSchedulerHook'), sampler_seed=dict(type='DistSamplerSeedHook'), timer=dict(type='IterTimerHook'), visualization=dict( draw=True, score_thr=0.1, test_out_dir= '/4T/home/fh/fenghao/VS_Code_projects/mmdetection3d/A_output/BEVFusion/test/results', type='Det3DVisualizationHook', vis_task='multi-modality_det')) default_scope = 'mmdet3d' env_cfg = dict( cudnn_benchmark=False, dist_cfg=dict(backend='nccl'), mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0)) input_modality = dict(use_camera=True, use_lidar=True) launcher = 'none' load_from = '/4T/home/fh/fenghao/VS_Code_projects/mmdetection3d_0/checkpoints/bevfusion_converted.pth' log_level = 'INFO' log_processor = dict(by_epoch=True, type='LogProcessor', window_size=50) lr = 0.0001 metainfo = dict(classes=[ 'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier', 'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone', ]) model = dict( bbox_head=dict( auxiliary=True, bbox_coder=dict( code_size=10, out_size_factor=8, pc_range=[ -54.0, -54.0, ], post_center_range=[ -61.2, -61.2, -10.0, 61.2, 61.2, 10.0, ], score_threshold=0.0, type='TransFusionBBoxCoder', voxel_size=[ 0.075, 0.075, ]), bn_momentum=0.1, common_heads=dict( center=[ 2, 2, ], dim=[ 3, 2, ], height=[ 1, 2, ], rot=[ 2, 2, ], vel=[ 2, 2, ]), decoder_layer=dict( cross_attn_cfg=dict(dropout=0.1, embed_dims=128, num_heads=8), ffn_cfg=dict( act_cfg=dict(inplace=True, type='ReLU'), embed_dims=128, feedforward_channels=256, ffn_drop=0.1, num_fcs=2), norm_cfg=dict(type='LN'), pos_encoding_cfg=dict(input_channel=2, num_pos_feats=128), self_attn_cfg=dict(dropout=0.1, embed_dims=128, num_heads=8), type='TransformerDecoderLayer'), hidden_channel=128, in_channels=512, loss_bbox=dict( loss_weight=0.25, reduction='mean', type='mmdet.L1Loss'), loss_cls=dict( alpha=0.25, gamma=2.0, loss_weight=1.0, reduction='mean', type='mmdet.FocalLoss', use_sigmoid=True), loss_heatmap=dict( loss_weight=1.0, reduction='mean', type='mmdet.GaussianFocalLoss'), nms_kernel_size=3, num_classes=10, num_decoder_layers=1, num_proposals=200, test_cfg=dict( dataset='nuScenes', grid_size=[ 1440, 1440, 41, ], nms_type=None, out_size_factor=8, pc_range=[ -54.0, -54.0, ], voxel_size=[ 0.075, 0.075, ]), train_cfg=dict( assigner=dict( cls_cost=dict( alpha=0.25, gamma=2.0, type='mmdet.FocalLossCost', weight=0.15), iou_calculator=dict(coordinate='lidar', type='BboxOverlaps3D'), iou_cost=dict(type='IoU3DCost', weight=0.25), reg_cost=dict(type='BBoxBEVL1Cost', weight=0.25), type='HungarianAssigner3D'), code_weights=[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2, ], dataset='nuScenes', gaussian_overlap=0.1, grid_size=[ 1440, 1440, 41, ], min_radius=2, out_size_factor=8, point_cloud_range=[ -54.0, -54.0, -5.0, 54.0, 54.0, 3.0, ], pos_weight=-1, voxel_size=[ 0.075, 0.075, 0.2, ]), type='TransFusionHead'), data_preprocessor=dict( bgr_to_rgb=False, mean=[ 123.675, 116.28, 103.53, ], pad_size_divisor=32, std=[ 58.395, 57.12, 57.375, ], type='Det3DDataPreprocessor', voxelize_cfg=dict( max_num_points=10, max_voxels=[ 120000, 160000, ], point_cloud_range=[ -54.0, -54.0, -5.0, 54.0, 54.0, 3.0, ], voxel_size=[ 0.075, 0.075, 0.2, ], voxelize_reduce=True)), fusion_layer=dict( in_channels=[ 80, 256, ], out_channels=256, type='ConvFuser'), img_backbone=dict( attn_drop_rate=0.0, convert_weights=True, depths=[ 2, 2, 6, 2, ], drop_path_rate=0.2, drop_rate=0.0, embed_dims=96, init_cfg=dict( checkpoint= 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_tiny_patch4_window7_224.pth', type='Pretrained'), mlp_ratio=4, num_heads=[ 3, 6, 12, 24, ], out_indices=[ 1, 2, 3, ], patch_norm=True, qk_scale=None, qkv_bias=True, type='mmdet.SwinTransformer', window_size=7, with_cp=False), img_neck=dict( act_cfg=dict(inplace=True, type='ReLU'), in_channels=[ 192, 384, 768, ], norm_cfg=dict(requires_grad=True, type='BN2d'), num_outs=3, out_channels=256, start_level=0, type='GeneralizedLSSFPN', upsample_cfg=dict(align_corners=False, mode='bilinear')), pts_backbone=dict( conv_cfg=dict(bias=False, type='Conv2d'), in_channels=256, layer_nums=[ 5, 5, ], layer_strides=[ 1, 2, ], norm_cfg=dict(eps=0.001, momentum=0.01, type='BN'), out_channels=[ 128, 256, ], type='SECOND'), pts_middle_encoder=dict( block_type='basicblock', encoder_channels=( ( 16, 16, 32, ), ( 32, 32, 64, ), ( 64, 64, 128, ), ( 128, 128, ), ), encoder_paddings=( ( 0, 0, 1, ), ( 0, 0, 1, ), ( 0, 0, ( 1, 1, 0, ), ), ( 0, 0, ), ), in_channels=5, norm_cfg=dict(eps=0.001, momentum=0.01, type='BN1d'), order=( 'conv', 'norm', 'act', ), sparse_shape=[ 1440, 1440, 41, ], type='BEVFusionSparseEncoder'), pts_neck=dict( in_channels=[ 128, 256, ], norm_cfg=dict(eps=0.001, momentum=0.01, type='BN'), out_channels=[ 256, 256, ], type='SECONDFPN', upsample_cfg=dict(bias=False, type='deconv'), upsample_strides=[ 1, 2, ], use_conv_for_no_stride=True), pts_voxel_encoder=dict(num_features=5, type='HardSimpleVFE'), type='BEVFusion', view_transform=dict( dbound=[ 1.0, 60.0, 0.5, ], downsample=2, feature_size=[ 32, 88, ], image_size=[ 256, 704, ], in_channels=256, out_channels=80, type='DepthLSSTransform', xbound=[ -54.0, 54.0, 0.3, ], ybound=[ -54.0, 54.0, 0.3, ], zbound=[ -10.0, 10.0, 20.0, ]), visualizer=dict( type='Det3DLocalVisualizer', vis_backends=[ dict(save_dir='outputs/', type='LocalVisBackend'), ])) optim_wrapper = dict( clip_grad=dict(max_norm=35, norm_type=2), optimizer=dict(lr=0.0002, type='AdamW', weight_decay=0.01), type='OptimWrapper') param_scheduler = [ dict( begin=0, by_epoch=False, end=500, start_factor=0.33333333, type='LinearLR'), dict( T_max=6, begin=0, by_epoch=True, convert_to_iter_based=True, end=6, eta_min_ratio=0.0001, type='CosineAnnealingLR'), dict( begin=0, by_epoch=True, convert_to_iter_based=True, end=2.4, eta_min=0.8947368421052632, type='CosineAnnealingMomentum'), dict( begin=2.4, by_epoch=True, convert_to_iter_based=True, end=6, eta_min=1, type='CosineAnnealingMomentum'), ] point_cloud_range = [ -54.0, -54.0, -5.0, 54.0, 54.0, 3.0, ] resume = False test_cfg = dict() test_dataloader = dict( batch_size=1, dataset=dict( ann_file='nus
Source: open-mmlab/mmdetection3d