open-mmlab / mmdetection3d

OpenMMLab's next-generation platform for general 3D object detection.
https://mmdetection3d.readthedocs.io/en/latest/
Apache License 2.0
5k stars 1.49k forks source link

[Bug] TypeError: __init__() got an unexpected keyword argument 'img_backbone' #2937

Closed Random-junhao closed 3 months ago

Random-junhao commented 3 months ago

Prerequisite

Task

I have modified the scripts/configs, or I'm working on my own tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmdetection3d

Environment

sys.platform: linux Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0] CUDA available: True MUSA available: False numpy_random_seed: 2147483648 GPU 0: NVIDIA GeForce RTX 3090 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.3, V11.3.58 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.12.1+cu113 PyTorch compiling details: PyTorch built with:

TorchVision: 0.13.1+cu113 OpenCV: 4.9.0 MMEngine: 0.10.3 MMDetection: 3.3.0 MMDetection3D: 1.4.0+ spconv2.0: False

Reproduces the problem - code sample

data_preprocessor=dict( type='Det3DDataPreprocessor',# 数据预处理器类型 voxel=True,# 开启体素化处理 voxel_layer=dict( max_num_points=32,# 每个体素最大的点数 point_cloud_range=[0,-39.68,-3,69.12,39.68,1,],

point_cloud_range = [0, -25.6, -3, 51.2, 25.6, 2],# 点云的范围,格式为 [x_min, y_min, z_min, x_max, y_max, z_max]

        voxel_size=[
            0.16,0.16,4,
        ],# 体素的尺寸,分别是 x、y 和 z 方向上的大小
        max_voxels=(
            16000,
            40000,
        ))),# 最大的体素数量
voxel_encoder=dict(
    type='PillarFeatureNet',# 体素编码器类型
    in_channels=4,# 输入通道数
    feat_channels=[64],# 特征通道数
    with_distance=False,# 不使用距离信息
    voxel_size=[0.16,0.16,4,],# 体素的尺寸,分别是 x、y 和 z 方向上的大小
    point_cloud_range=[0,-39.68,-3,69.12,39.68,1,]),# 点云的范围
middle_encoder=dict(
    type='PointPillarsScatter', in_channels=64, output_shape=[512,256]), #中间编码器类型# [64,496,432] 8
    #type='PointPillarsScatter', in_channels=64, output_shape=[496,432]),#KITTI

backbone=dict(
    type='SECOND',#骨干网络类型
    in_channels=64, # 输入通道数
    layer_nums=[3,5,5,],# 层数
    layer_strides=[2,2,2,],# 层步长
    out_channels=[64,128,256,]),# [8,64,248,216] 3 [8,128,124,108] [8,256,62,54]# 输出通道数
img_backbone=dict(
    type='ResNet50'),
fusion_layer=dict(
    type='SpatialAlignmentFusion',
    chanel_num=256),

Reproduces the problem - command or script

sudo python tools/train.py configs/pointpillars/pointpillars_hv_secfpn_8xb6-160e_vod-3d-3class.py

Reproduces the problem - error message

Traceback (most recent call last): File "tools/train.py", line 145, in main() File "tools/train.py", line 134, in main runner = Runner.from_cfg(cfg) File "/home/bitcqic/software/yes/envs/mmdetection/lib/python3.8/site-packages/mmengine/runner/runner.py", line 462, in from_cfg runner = cls( File "/home/bitcqic/software/yes/envs/mmdetection/lib/python3.8/site-packages/mmengine/runner/runner.py", line 429, in init self.model = self.build_model(model) File "/home/bitcqic/software/yes/envs/mmdetection/lib/python3.8/site-packages/mmengine/runner/runner.py", line 836, in build_model model = MODELS.build(model) File "/home/bitcqic/software/yes/envs/mmdetection/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build return self.build_func(cfg, *args, kwargs, registry=self) File "/home/bitcqic/software/yes/envs/mmdetection/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 232, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/bitcqic/software/yes/envs/mmdetection/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 121, in build_from_cfg obj = obj_cls(args) # type: ignore TypeError: init() got an unexpected keyword argument 'img_backbone'

Additional information

No response