mmdetection3d
mmdetection3d copied to clipboard
Got size error after update waymo datasets whth the script update_data_coors.py
Describe the issue
I prepared the waymo datasets with the mmdet3d0.18 before. Rencently I updated the 1.0rc2 version and run update_data_coors.py
to update the waymo datasets.
Reproduction
- What command or script did you run?
bash tools/dist_train.sh configs/pointpillars/hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-car.py 1 --work-dir ./work_dirs/hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-car
- What config dir you run?
hv_pointpillars_secfpn_sbn_2x16_2x_waymoD5-3d-car.py
- Did you make any modifications on the code or config? Did you understand what you have modified? No
- What dataset did you use? Waymo
Environment
sys.platform: linux
Python: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0]
CUDA available: True
GPU 0,1: GeForce RTX 3090
CUDA_HOME: /usr/local/cuda-11.1
NVCC: Build cuda_11.1.TC455_06.29069683_0
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.9.0+cu111
PyTorch compiling details: PyTorch built with:
- GCC 7.3
- C++ Version: 201402
- Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- NNPACK is enabled
- CPU capability usage: AVX2
- CUDA Runtime 11.1
- NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
- CuDNN 8.0.5
- Magma 2.5.2
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.1, CUDNN_VERSION=8.0.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON,
TorchVision: 0.10.0+cu111
OpenCV: 4.5.5
MMCV: 1.4.8
MMCV Compiler: GCC 7.3
MMCV CUDA Compiler: 11.1
MMDetection: 2.25.0
MMSegmentation: 0.24.1
MMDetection3D: 1.0.0rc2+
spconv2.0: True
Results
To know what happened in data transform pipeline, I add some print in LoadPointsFromFile
. The results are as follow. It seems that the bin file in waymo_gt_database has the wrong dimensions.
2022-07-23 16:34:51.319113: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.0
filename: data/waymo/kitti_format/training/velodyne/0322114.bin
points shape: (1115538,)
filename: data/waymo/kitti_format/training/velodyne/0458061.bin
points shape: (1007298,)
filename: data/waymo/kitti_format/training/velodyne/0265040.bin
points shape: (857022,)
filename: data/waymo/kitti_format/waymo_gt_database/282146_Car_25.bin
points shape: (10950,)
filename: data/waymo/kitti_format/waymo_gt_database/223061_Car_63.bin
points shape: (25,)
Traceback (most recent call last):
File "tools/train.py", line 263, in <module>
filename: data/waymo/kitti_format/training/velodyne/0189153.bin
main()
File "tools/train.py", line 252, in main
train_model(
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/apis/train.py", line 344, in train_model
train_detector(
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/apis/train.py", line 319, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
data = self._next_data()
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
points shape: (1026276,)
data.reraise()
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/_utils.py", line 425, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/opt/anaconda3/envs/MMDet3dv1.0/lib/python3.8/site-packages/mmdet/datasets/dataset_wrappers.py", line 178, in __getitem__
return self.dataset[idx % self._ori_len]
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/datasets/custom_3d.py", line 433, in __getitem__
data = self.prepare_train_data(idx)
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/datasets/custom_3d.py", line 227, in prepare_train_data
example = self.pipeline(input_dict)
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/datasets/pipelines/compose.py", line 48, in __call__
data = t(data)
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/datasets/pipelines/transforms_3d.py", line 328, in __call__
sampled_dict = self.db_sampler.sample_all(
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/datasets/pipelines/dbsampler.py", line 271, in sample_all
s_points = self.points_loader(results)['points']
File "/data1/cqy/mmdet3d1.0.0/mmdetection3dv1.0.0rc2/mmdet3d/datasets/pipelines/loading.py", line 424, in __call__
points = points.reshape(-1, self.load_dim)
ValueError: cannot reshape array of size 25 into shape (6)
Some difference between v1.0rc3 and 0.18 in waymo data preparation.
v1.0rc3:
https://github.com/open-mmlab/mmdetection3d/blob/eb5a5a2d166d2d60dfbdffe63b925cb37a6541e3/tools/data_converter/create_gt_database.py#L571
0.18:
https://github.com/open-mmlab/mmdetection3d/blob/6e1e5d1a06cbe2f1db5a2502f1e76a522b9e9c92/tools/data_converter/create_gt_database.py#L209
Should I regenerate the waymo_gt_database
and other files?
Yes, please refer to the compatibility doc for more details.