[Bug] PETR file out of date

Author: WendellZ524Created Nov 4, 2023Updated Apr 19, 2026

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

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

Reproduces the problem - command or script

bash
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

Source: open-mmlab/mmdetection3d