Song-Jingyu / PointPainting

This repository is an open-source PointPainting package which is easy to understand, deploy and run!
MIT License
238 stars 45 forks source link

ValueError: cannot reshape array of size 308 into shape (8) #30

Closed wanghangege closed 1 year ago

wanghangege commented 1 year ago

Thanks for your good job, but I have a dataset question. The error I met as follows:

2022-11-23 19:53:31,224 INFO **********************Start training home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/tools/cfgs/kitti_models/pointpillar_painted(default)********************** epochs: 0%| | 0/10 [00:00<?, ?it/s] epochs: 0%| | 0/10 [00:09<?, ?it/s] Traceback (most recent call last): File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/tools/train_utils/train_utils.py", line 93, in train_model dataloader_iter=dataloader_iter File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/tools/train_utils/train_utils.py", line 19, in train_one_epoch batch = next(dataloader_iter) File "/home/seu/anaconda3/envs/DRLearning/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in __next__ data = self._next_data() File "/home/seu/anaconda3/envs/DRLearning/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/seu/anaconda3/envs/DRLearning/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/seu/anaconda3/envs/DRLearning/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/pcdet/datasets/kitti/painted_kitti_dataset.py", line 409, in __getitem__ data_dict = self.prepare_data(data_dict=input_dict) File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/pcdet/datasets/dataset.py", line 124, in prepare_data 'gt_boxes_mask': gt_boxes_mask File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/pcdet/datasets/augmentor/data_augmentor.py", line 93, in forward data_dict = cur_augmentor(data_dict=data_dict) File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/pcdet/datasets/augmentor/database_sampler.py", line 213, in __call__ data_dict = self.add_sampled_boxes_to_scene(data_dict, sampled_gt_boxes, total_valid_sampled_dict) File "/home/seu/data_backup/new_disk/bbdata/pro_detect/PointPainting-main/detector/pcdet/datasets/augmentor/database_sampler.py", line 134, in add_sampled_boxes_to_scene [-1, self.sampler_cfg.NUM_POINT_FEATURES]) ValueError: cannot reshape array of size 308 into shape (8) python-BaseException

Towards the debug, I find the problem is the number of points, I.e the points of "file_path" ( '.bin' ) can not be devided by 8, so, how I solve the problem? I use the kitti datasets。 " obj_points = np.fromfile(str(file_path), dtype=np.float32).reshape( [-1, self.sampler_cfg.NUM_POINT_FEATURES]) " please help me ....

wanghangege commented 1 year ago

sorry, I have solved thr problems by create new bin files, it is my negligence.

Song-Jingyu commented 1 year ago

Thanks for leaving your notes here.