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.52k forks source link

[Bug] PETR file out of date #2799

Open WendellZ524 opened 10 months ago

WendellZ524 commented 10 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

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

Environment

torch 1.13.1+cu116 pypi_0 pypi torchaudio 0.13.1+cu116 pypi_0 pypi torchvision 0.14.1+cu116 pypi_0 pypi mmcv 2.0.0rc4 pypi_0 pypi mmdet 3.1.0 dev_0 mmdet3d 1.3.0 dev_0 mmengine 0.9.0 dev_0 mmsegmentation 1.2.1 dev_0

Reproduces the problem - code sample

img_h, img_w, _ = img_metas[img_id]['img_shape'][cam_id]

Reproduces the problem - command or script

python tools/train.py projects/PETR/configs/petr_vovnet_gridmask_p4_800x320.py

Reproduces the problem - error message

Exception has occurred: ValueError
not enough values to unpack (expected 3, got 2)
  File "/home/zephyr/openmmlab/mmdetection3d/projects/PETR/petr/petr_head.py", line 449, in forward
    img_h, img_w, _ = img_metas[img_id]['img_shape'][cam_id]

Additional information

  1. I use the nuscenes dataset and download the data_info.pkl from official website
  2. According to my previous experience I am using the v2.0 dataset format, but the code is still supported for 1.0
zhangtingyu11 commented 9 months ago

The same issue, and it can be solved by change img_h, img_w, _ = img_metas[img_id]['img_shape'][cam_id] to img_h, img_w = img_metas[img_id]['img_shape'][cam_id]