OpenDriveLab / UniAD

[CVPR 2023 Best Paper Award] Planning-oriented Autonomous Driving
Apache License 2.0
3.5k stars 393 forks source link

KeyError: 'traj' #71

Open meua opened 1 year ago

meua commented 1 year ago

Hello, I encountered the following error when executing the visualization command:

(uniad38) jarvis@jia:~/coding/pyhome/github.com/meua/UniAD$ ./tools/uniad_vis_result.sh
======
Loading NuScenes tables for version v1.0-trainval...
23 category,
8 attribute,
4 visibility,
64386 instance,
12 sensor,
10200 calibrated_sensor,
2631083 ego_pose,
68 log,
850 scene,
34149 sample,
2631083 sample_data,
1166187 sample_annotation,
4 map,
Done loading in 18.497 seconds.
======
Reverse indexing ...
Done reverse indexing in 3.7 seconds.
======
Traceback (most recent call last):
  File "./tools/analysis_tools/visualize/run.py", line 340, in <module>
    main(args)
  File "./tools/analysis_tools/visualize/run.py", line 302, in main
    viser = Visualizer(version='v1.0-trainval', predroot=args.predroot, dataroot='data/nuscenes', **render_cfg)
  File "./tools/analysis_tools/visualize/run.py", line 62, in __init__
    self.predictions = self._parse_predictions_multitask_pkl(predroot)
  File "./tools/analysis_tools/visualize/run.py", line 111, in _parse_predictions_multitask_pkl
    trajs = outputs[k][f'traj'].numpy()
KeyError: 'traj'
(uniad38) jarvis@jia:~/coding/pyhome/github.com/meua/UniAD$ 

The contents of the ./tools/uniad_vis_result.sh file are as follows:

#!/bin/bash

python ./tools/analysis_tools/visualize/run.py \
    --predroot ./output/results.pkl \
    --out_folder ./data/visualize/output \
    --demo_video ./data/video/test.mp4 \
    --project_to_cam True
beyondpzk commented 1 year ago

same question +1.

I have got the results.pkl correctly, the logs is following:

image

image

image

image

but when I run the ./tools/uniad_vis_result.sh I also got "KeyError traj"

And I found no "traj" in results.pkl.

image

meua commented 1 year ago

same question +1.

I have got the results.pkl correctly, the logs is following:

image

image

image

image

but when I run the ./tools/uniad_vis_result.sh I also got "KeyError traj"

And I found no "traj" in results.pkl.

image

Please help me if you solve it, thank you.

beyondpzk commented 1 year ago

I got following result jpgs

image

ilnehc commented 1 year ago

@meua @beyondpzk This is a bug from inconsistent results saving in the test process, when you visualize outputs from stage 1 only. You need the full results (stage 2). See https://github.com/OpenDriveLab/UniAD/issues/39#issuecomment-1617641348. We will fix it.

meua commented 1 year ago

@meua @beyondpzk This is a bug from inconsistent results saving in the test process, when you visualize outputs from stage 1 only. You need the full results (stage 2). See #39 (comment). We will fix it.

Thank you very much, I finally output the visualization information through 2e2. ./tools/uniad_dist_eval.sh ./projects/configs/stage2_e2e/base_e2e.py ./ckpts/uniad_base_e2e.pth 1 && python ./tools/analysis_tools/visualize/run.py --predroot ./output/results.pkl --out_folder ./output_visualize --demo_video test_demo.avi --project_to_cam True

ZhoubinXM commented 1 year ago

./tools/uniad_dist_eval.sh ./projects/configs/stage2_e2e/base_e2e.py ./ckpts/uniad_base_e2e.pth 1 && python ./tools/analysis_tools/visualize/run.py --predroot ./output/results.pkl --out_folder ./output_visualize --demo_video test_demo.avi --project_to_cam True

If you want to get visualization results, before end-to-end training or eval, you can check the run.py script and comment out the code about traj, you can get pv and bev images of det, like: image

meua commented 1 year ago

./tools/uniad_dist_eval.sh ./projects/configs/stage2_e2e/base_e2e.py ./ckpts/uniad_base_e2e.pth 1 && python ./tools/analysis_tools/visualize/run.py --predroot ./output/results.pkl --out_folder ./output_visualize --demo_video test_demo.avi --project_to_cam True

If you want to get visualization results, before end-to-end training or eval, you can check the run.py script and comment out the code about traj, you can get pv and bev images of det, like: image

Okay, thank you very much for your input, I will try it soon.