megvii-research / PETR

[ECCV2022] PETR: Position Embedding Transformation for Multi-View 3D Object Detection & [ICCV2023] PETRv2: A Unified Framework for 3D Perception from Multi-Camera Images
Other
869 stars 131 forks source link

数据集的results['sweeps']字段下面没有camera相关的keys。 #115

Open BaoWentz opened 1 year ago

BaoWentz commented 1 year ago

https://github.com/megvii-research/PETR/blob/e48faec8aa24bdd14f95692428ddc4982f2f71cb/projects/mmdet3d_plugin/datasets/pipelines/loading.py#L121 请问一下,为什么我生成的pkl文件里面results['sweeps']字段下面没有摄像头相关的keys,下面是results['sweeps'][0]这个字段里面的内容,是我生成数据集的命令有问题吗?或者是我的nuscenes-devkit版本不对?

{'data_path': 'data/nuscenes_mini/sweeps/LIDAR_TOP/n008-2018-08-28-16-43-51-0400__LIDAR_TOP__1535489300497031.pcd.bin', 'type': 'lidar', 'sample_data_token': 'f524203dcc2a4dbab3ccf15f4654fef5', 'sensor2ego_translation': [0.985793, 0.0, 1.84019], 'sensor2ego_rotation': [0.706749235646644, -0.015300993788500868, 0.01739745181256607, -0.7070846669051719], 'ego2global_translation': [1316.3782142312477, 1038.5936760118025, 0.0], 'ego2global_rotation': [0.35582469902454716, 0.0020289594930361066, -0.009421163274953188, 0.9345030275873976], 'timestamp': 1535489300497031, 'sensor2lidar_rotation': array([[ 1.00000000e+00, 9.16590611e-06, -1.20981344e-05], [-9.16657050e-06, 9.99999998e-01, -5.49176100e-05], [ 1.20976310e-05, 5.49177209e-05, 9.99999998e-01]]), 'sensor2lidar_translation': array([-1.47137341e-05, -1.02824184e-04, 4.93552271e-05])}

下面是我的报错信息: Traceback (most recent call last): File "./tools/train.py", line 281, in main() File "./tools/train.py", line 277, in main meta=meta) File "common/mmdetection3d/mmdet3d/apis/train.py", line 35, in train_model meta=meta) File "/root/miniconda3/lib/python3.7/site-packages/mmdet/apis/train.py", line 244, in train_detector runner.run(data_loaders, cfg.workflow) File "/root/miniconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run epoch_runner(data_loaders[i], **kwargs) File "/root/miniconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train for i, data_batch in enumerate(self.data_loader): File "/root/miniconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 521, in next data = self._next_data() File "/root/miniconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 561, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/root/miniconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/miniconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "common/mmdetection3d/mmdet3d/datasets/dataset_wrappers.py", line 68, in getitem return self.dataset[ori_idx] File "common/mmdetection3d/mmdet3d/datasets/custom_3d.py", line 357, in getitem data = self.prepare_train_data(idx) File "common/mmdetection3d/mmdet3d/datasets/custom_3d.py", line 154, in prepare_train_data example = self.pipeline(input_dict) File "/root/miniconda3/lib/python3.7/site-packages/mmdet/datasets/pipelines/compose.py", line 41, in call data = t(data) File "projects/mmdet3d_plugin/datasets/pipelines/loading.py", line 122, in call results['filename'].extend([sweep[sensor]['data_path'] for sensor in self.sensors]) File "projects/mmdet3d_plugin/datasets/pipelines/loading.py", line 122, in results['filename'].extend([sweep[sensor]['data_path'] for sensor in self.sensors]) KeyError: 'CAM_FRONT'

CarkusL commented 1 year ago

same question

yingfei1016 commented 1 year ago

The default data processing of mmdet3d will only process lidar's sweep data. We further run https://github.com/megvii-research/Petr/blob/main/tools/generate sweep pkl.py to save the camera's sweep data in the sweep list.

pianogGG commented 1 year ago

@yingfei1016 I use https://github.com/megvii-research/Petr/blob/main/tools/generate sweep pkl.py to generate ,mmdet3d_nuscenes_30f_infos_train.pkl and after this the file[basemap maps nuscenes_dbinfos_train.pkl nuscenes_gt_database nuscenes_infos_test.pkl nuscenes_infos_train.pkl nuscenes_infos_val.pkl prediction samples sweeps v1.0-test v1.0-trainval] are all gone, this is why?

yingfei1016 commented 1 year ago

@pianogGG https://github.com/megvii-research/Petr/blob/main/tools/generate sweep pkl.py will not delete other files. It maybe the other problem.

If you want to run the temporal version, I suggest you run this one. The performance and time are greatly optimized.