cure-lab / MagicDrive

[ICLR24] Official implementation of the paper “MagicDrive: Street View Generation with Diverse 3D Geometry Control”
https://gaoruiyuan.com/magicdrive/
GNU Affero General Public License v3.0
419 stars 22 forks source link

Question about demo/run.py show_box = true #31

Closed axxx-xxxa closed 4 weeks ago

axxx-xxxa commented 1 month ago

When show_box = true in test_config.yaml

Error executing job with overrides: ['resume_from_checkpoint=/home/magicdrive-files/SDv1.5mv-rawbox_2023-09-07_18-39_224x400', '++runner.enable_xformers_memory_efficient_attention=false']
Traceback (most recent call last):
  File "demo/run.py", line 69, in main
    map_size=target_map_size)
  File "./magicdrive/misc/test_utils.py", line 301, in run_one_batch
    for bi in range(bs)
  File "./magicdrive/misc/test_utils.py", line 301, in <listcomp>
    for bi in range(bs)
  File "./magicdrive/misc/test_utils.py", line 56, in draw_box_on_imgs
    val_input['meta_data']['img_aug_matrix'][idx].data.numpy(),
  File "./magicdrive/runner/box_visualizer.py", line 111, in show_box_on_views
    img_out = np.asarray(Image.open(temp_path))  # ensure image is loaded
  File "/opt/conda/envs/magicdrivepy37/lib/python3.7/site-packages/PIL/Image.py", line 3236, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '.tmp/tmprxi40ph_.png'

When show_box = false in test_config.yaml There is a problem with the loop iteration over gen_imgs_wb_list. This loop does not execute because there are no elements in gen_imgs_wb_list.

for map_img, ori_imgs, ori_imgs_wb, gen_imgs_list, gen_imgs_wb_list in zip(*return_tuples):

I deleted gen_imgs_wb_list in that line and commented code related to show_box=true, and the script("demo/run.py") can run correctly. So I think there is no problem with enviroment. I'm using the nuscenes v1.0 mini dataset, and I suspect this happened cuz not reading the files related to the 3D BOX labels in the groundtruth data.

flymin commented 1 month ago

Yes, it seems there are some bugs here. However, it does not affect the major functionality, and I do not have time to fix them.

PR is welcome. Thanks.

flymin commented 4 weeks ago

I have solved the issue when show_box=false. However, it is unclear what causes the first case in your issue. Please provide more context like the command version of bevfusion.

I will close it for now. If you have any follow-ups, please feel free to re-open.