open-mmlab / mmdetection3d

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

Some bugs in the multi-modality demo in the 1.1 branch #1804

Open JingweiZhang12 opened 2 years ago

JingweiZhang12 commented 2 years ago

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Describe the bug I followed the guide in inference.md and could not run the multi-modality demo successfullly:

Traceback (most recent call last):
  File "demo/multi_modality_demo.py", line 75, in <module>
    main(args)
  File "demo/multi_modality_demo.py", line 53, in main
    result, data = inference_multi_modality_detector(model, args.pcd, args.img,
  File "/home/PJLAB/zhangjingwei/code/mmdetection3d/mmdet3d/apis/inference.py", line 216, in inference_multi_modality_detector
    data_list = mmengine.load(ann_file)['data_list']
TypeError: list indices must be integers or slices, not str
Traceback (most recent call last):                                                                                                                                                                                                                            
  File "demo/multi_modality_demo.py", line 75, in <module>                                                                     
    main(args)                                                                                                                                                                                                                                                
  File "demo/multi_modality_demo.py", line 53, in main                                                                         
    result, data = inference_multi_modality_detector(model, args.pcd, args.img,                                                
  File "/home/PJLAB/zhangjingwei/code/mmdetection3d/mmdet3d/apis/inference.py", line 223, in inference_multi_modality_detector                                                                                                                                
    img_path = data_info['images'][cam_type]['img_path']                                                                                                                                                                                                      
KeyError: 'images'

(Pdb) data_list[0].keys()                                                                                                                                                                                                                                     
dict_keys(['point_cloud', 'pts_path', 'image', 'calib', 'annos', 'bbox_2d'])                                                                                                                                                                                  
(Pdb) data_list[0]['image']                                                                                                                                                                                                                                   
{'image_idx': 17, 'image_shape': array([530, 730], dtype=int32), 'image_path': 'image/000017.jpg'}

Reproduction

  1. What command or script did you run?
A placeholder for the command.
  1. Did you make any modifications on the code or config? Did you understand what you have modified?
  2. What dataset did you use?

Environment

  1. Please run python mmdet3d/utils/collect_env.py to collect necessary environment information and paste it here.
  2. You may add addition that may be helpful for locating the problem, such as
    • How you installed PyTorch [e.g., pip, conda, source]
    • Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)

Error traceback If applicable, paste the error trackback here.

A placeholder for trackback.

Bug fix If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

ZCMax commented 2 years ago

The refactored demo script needs the new data format pkl info file. What is your runnning command?

Bitfultea commented 1 year ago

I try with python demo/multi_modality_demo.py demo/data/sunrgbd/sunrgbd_000017.bin demo/data/sunrgbd/sunrgbd_000017.jpg demo/data/sunrgbd/sunrgbd_000017_infos.pkl projects/TR3D/configs/tr3d_1xb16_sunrgbd-3d-10class.py weights/TR3D/tr3d_1xb16_sunrgbd-3d-10class.pth --show Got the same error. Any suggestion?

xifen523 commented 1 year ago

I had the same problem on the main branch, did you guys solve it?