V2AI / Det3D

World's first general purpose 3D object detection codebse.
https://arxiv.org/abs/1908.09492
Apache License 2.0
1.5k stars 298 forks source link

unable to do inference on test set #163

Closed GitRooky closed 2 years ago

GitRooky commented 2 years ago

When I run python tools/dist_test_1.py /home/leo/research/Det3D/examples/point_pillars/configs/nusc_all_point_pillars_mghead_syncbn.py --work_dir ./work_dirs/ --checkpoint /home/leo/research/Det3D/checkpoint/pointpillars/latest.pth --speed_test --testset, following errors are raised

[ ] 0/6008, elapsed: 0s, ETA:Traceback (most recent call last): File "tools/dist_test_1.py", line 211, in main() File "tools/dist_test_1.py", line 157, in main for i, data_batch in enumerate(data_loader): File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next data = self._next_data() File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data return self._process_data(data) File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data data.reraise() File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/_utils.py", line 429, in reraise raise self.exc_type(msg) TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop data = fetcher.fetch(index) File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/leo/.conda/envs/det3d/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/leo/research/Det3D/det3d/datasets/nuscenes/nuscenes.py", line 177, in getitem return self.get_sensor_data(idx) File "/home/leo/research/Det3D/det3d/datasets/nuscenes/nuscenes.py", line 172, in get_sensordata data, = self.pipeline(res, info) File "/home/leo/research/Det3D/det3d/datasets/pipelines/compose.py", line 23, in call res, info = t(res, info) TypeError: cannot unpack non-iterable type object

Can anyone help me fix it ? @poodarchu @tianweiy @YoushaaMurhij

YoushaaMurhij commented 2 years ago

@GitRooky , Can you check the data path in your configs file?

GitRooky commented 2 years ago

@GitRooky , Can you check the data path in your configs file?

@GitRooky , Can you check the data path in your configs file? @YoushaaMurhij

I have checked the data path, and change them. But the same problem still exists. Can you help me out ?

The data path configurations are listed as follows _b_sampler = dict( type="GT-AUG", enable=False, db_info_path="/home/leo/DATA/dataset/nuscenes/trainval/dbinfos_train_10sweeps_withvelo.pkl", ... train_anno = "/home/leo/DATA/dataset/nuscenes/trainval/infos_train_10sweeps_withvelo.pkl" val_anno = "/home/leo/DATA/dataset/nuscenes/trainval/infos_val_10sweeps_withvelo.pkl" test_anno = "/home/leo/DATA/dataset/nuscenes/trainval/v1.0-test/infos_test_10sweepswithvelo.pkl"

And my dataset directory is organized as follows

_ROOT_NUSC ├── trainval ├── dbinfos_train_10sweeps_withvelo.pkl ├── gt_database_10sweeps_withvelo│
├── infos_train_10sweeps_withvelo.pkl ├── infos_val_10sweeps_withvelo.pkl ├── maps ├── samples ├── sweeps ├── v1.0-test ├── v1.0-trainval └── val

YoushaaMurhij commented 2 years ago

If the paths are correct and the data is prepared correctly, I am not sure what could cause this issue.

YoushaaMurhij commented 2 years ago

I see you added testset flag. Are you sure that you prepared it as well?

GitRooky commented 2 years ago

I see you added testset flag. Are you sure that you prepared it as well?

Of course. I ran python tools/create_data.py nuscenes_data_prep --root_path /home/leo/DATA/dataset/nuscenes/trainval//v1.0-test/ --version v1.0-test, before attempting to inference on the test set. All the test using CenterPoint has no problem, but it doesn't work on the same module of Det3D.

GitRooky commented 2 years ago

I have solved the problem by changing the loading.py of Det3D with loading.py of CenterPoint