open-mmlab / mmdetection3d

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

[Bug] Result is saved to /tmp/tmpmp_yh0x5/results.pkl. #2188

Open wszhengjx opened 1 year ago

wszhengjx commented 1 year ago

Prerequisite

Task

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

Branch

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

Environment

ubuntu20.04

Reproduces the problem - code sample

[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 3624/3624, 73.3 task/s, elapsed: 49s, ETA: 0s Result is saved to /tmp/tmpzp7n6imw/results.pkl. 2023-01-02 12:47:26,511 - mmdet - INFO - Car AP@0.70, 0.70, 0.70: bbox AP:10.1963, 7.1649, 7.1313 bev AP:62.6201, 44.8156, 44.7846 3d AP:46.7023, 32.4005, 32.3829 aos AP:4.89, 3.41, 3.39 Car AP@0.70, 0.50, 0.50:

Reproduces the problem - command or script

when training

Reproduces the problem - error message

the work-dir is right ,but the weights saved at a wrong tmp place

Additional information

No response

JingweiZhang12 commented 1 year ago

It's normal. When you don't specify the saved path of prediction results, the results is saved in the temporary path. If you want to get the prediction results, you can specify the path in the command script --cfg-options pklfile_prefix=${saved_path}

wszhengjx commented 1 year ago

I got it ,Thanks very much

------------------ 原始邮件 ------------------ 发件人: "Jingwei @.>; 发送时间: 2023年1月3日(星期二) 晚上7:47 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [open-mmlab/mmdetection3d] [Bug] Result is saved to /tmp/tmpmp_yh0x5/results.pkl. (Issue #2188)

It's normal. When you don't specify the saved path of prediction results, the results is saved in the temporary path. If you want to get the prediction results, you can specify the path in the command script --cfg-options pklfile_prefix=${saved_path}

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

abadithela commented 3 months ago

Hi @JingweiZhang12 and @wszhengjx:

I'm trying to save prediction results to the pickle file but not sure where exactly to run this command. When I run the following from terminal:

python tools/test.py projects/BEVFusion/configs/bevfusion_lidar-cam_voxel0075_second_secfpn_8xb4-cyclic-20e_nus-3d.py  checkpoints/bevfusion_converted.pth  --cfg-options pklfile_prefix="/home/apurvabadithela/nuscenes_dataset/inference_results/bevfusion_model/results.pkl"  --task 'multi-modality_det'

I get the following error:

usage: test.py [-h] [--work-dir WORK_DIR] [--ceph] [--show]
               [--show-dir SHOW_DIR] [--score-thr SCORE_THR]
               [--task {mono_det,multi-view_det,lidar_det,lidar_seg,multi-modality_det}]
               [--wait-time WAIT_TIME]
               [--cfg-options CFG_OPTIONS [CFG_OPTIONS ...]]
               [--launcher {none,pytorch,slurm,mpi}] [--tta]
               [--local_rank LOCAL_RANK]
               config checkpoint
test.py: error: unrecognized arguments: —-cfg-options pklfile_prefix=/home/apurvabadithela/nuscenes_dataset/inference_results/bevfusion_model/results.pkl

I have also tried adding pklfile_prefix to the test evaluator dictionary (config_file), but I get an error saying that this keyword is not recognized. Essentially, I'm trying to figure out how to save prediction results to a file, and the documentation page (documentation) on this was not very clear.

Thanks, Apurva

gerardmartin2 commented 1 month ago

Hello @abadithela, have you been able to do it?

Thanks

abadithela commented 1 week ago

@gerardmartin2 Unfortunately, no. Have you figured it out?

gerardmartin2 commented 1 week ago

@abadithela I used BEVFusion from the original implementation (not the one here in mmdet) and I ran the code with the following command: "torchpack dist-run -np 1 python ~/bevfusion/tools/test.py ~/bevfusion/configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/convfuser.yaml /path_to_checkpoint.pth --eval bbox --out path_to_pkl.pkl"

Example: torchpack dist-run -np 1 python ~/bevfusion/tools/test.py ~/bevfusion/configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/convfuser.yaml /mnt/work/users/gerard.martin.pey/ckpts/baseline_lr/BEVFusion_Baseline_epoch_4.pth --eval bbox --out ~/Baseline_lr_3FCAMS_180BL_180BGT.pkl

gerardmartin2 commented 1 week ago

So basically using --out helped me define where I wanted to place the .pkl file