open-mmlab / mmdetection3d

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

[Bug] Concatenating Dataset #2296

Closed enesdorukadastec closed 1 year ago

enesdorukadastec commented 1 year ago

What's the feature?

Hi i created 3d lidar dataset as same as Nuscene dataset format. I want to concatenate this dataset for training and i followed mmdetection3d documentation steps but i got error.

with_velocity = False dataset_nuscene = dict( type=dataset_type, data_root=data_root, ann_file=data_root + 'nuscenes_infos_train.pkl', pipeline=train_pipeline, classes=class_names, with_velocity=with_velocity, test_mode=False, use_valid_flag=True, box_type_3d='LiDAR')

dataset_adascene = dict( type=dataset_type_adas, data_root=data_root_adas, ann_file=data_root_adas + 'adascenes_infos_train.pkl', pipeline=train_pipeline, classes=class_names, with_velocity=with_velocity, test_mode=False, use_valid_flag=True, box_type_3d='LiDAR')

data = dict( train=dict( type='CBGSDataset', pipeline = train_pipeline, dataset=[dataset_nuscene, dataset_adascene]), val=dict( pipeline=test_pipeline, classes=class_names, with_velocity=with_velocity), test=dict( pipeline=test_pipeline, classes=class_names, with_velocity=with_velocity))

=====================================

Traceback (most recent call last): File "tools/train.py", line 303, in main() File "tools/train.py", line 257, in main val_dataset.pipeline = cfg.data.train.dataset.pipeline AttributeError: 'list' object has no attribute 'pipeline'

Any other context?

No response

Xiangxu-0103 commented 1 year ago

You may try to Concat datasets with ConcatDataset following this config as an example.

enesdorukadastec commented 1 year ago

Thanks it works

data = dict( train=dict( type='ConcatDataset', pipeline = train_pipeline, datasets=[dataset_nuscene, dataset_adascene]), val=dict( pipeline=test_pipeline, classes=class_names, with_velocity=with_velocity), test=dict( pipeline=test_pipeline, classes=class_names, with_velocity=with_velocity))