open-mmlab / mmdetection3d

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

TypeError: The annotations loaded from annotation file should be a dict, but got <class 'list'>! The intention of why not directly making "dict .pkl"? #2829

Open perrydoremi opened 12 months ago

perrydoremi commented 12 months ago

What is the feature?

Currently I'm implementing my own dataset in mmdetection3d for point cloud segmentation task. I got this error when testing pointnet2.

TypeError: The annotations loaded from annotation file should be a dict, but got <class 'list'>! when testing pointnet2.

I checked all the issues and found that the current .pkl file should be a "dict" not a "list" as before, but I'm so confused how this could happen cause I just forked the newest mmdet3d and implemented my dataset from scratch. So I went through all the files that related to data preparation, and found something that's difficult to understand:

Take s3dis dataset for eg: In create_data.py, why in s3dis_data_prep function, a update_pkl_infos is compulsorily used to convert "list .pkl" to "dict .pkl" instead of directly making "dict .pkl" files in indoor.create_indoor_info_file ? Could you pls help me explain the intention here?

Really appreciate mmdet3d's dedicated work so far, and many thx!!!

Any other context?

No response

ThaiNguyenMonash commented 10 months ago

how to change that to dict?

temex12 commented 10 months ago

how to change that to dict?

I believe you can use the update_infos_to_v2.py to change it. As below: python tools/dataset_converters/update_infos_to_v2.py --dataset ${DATA_SET} --pkl-path ${PKL_PATH} --out-dir ${OUT_DIR} Example usage: python update_infos_to_v2.py --dataset kitti --pkl-path \data\kitti\kitti_infos_train.pkl --out-dir \data\kitti_updated