xinge008 / Cylinder3D

Rank 1st in the leaderboard of SemanticKITTI semantic segmentation (both single-scan and multi-scan) (Nov. 2020) (CVPR2021 Oral)
Apache License 2.0
856 stars 180 forks source link

Error in shape #47

Closed FrancescoMandru closed 3 years ago

FrancescoMandru commented 3 years ago

I'm running now your code with no modifications. Just using CPU to do some tests and I get the following:

First I get this error if I set the device to CPU:

root@f125ceb56018:/working_dir# python -m cylindernet.train_cylinder_asym
/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  return torch._C._cuda_getDeviceCount() > 0
/working_dir/cylindernet/train_cylinder_asym.py
[480 360  32]
  0%|                                                                                                                 | 0/502 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/working_dir/cylindernet/train_cylinder_asym.py", line 167, in <module>
    main(args)
  File "/working_dir/cylindernet/train_cylinder_asym.py", line 133, in main
    outputs = my_model(train_pt_fea_ten, train_vox_ten, train_batch_size)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/working_dir/cylindernet/network/cylinder_spconv_3d.py", line 42, in forward
    coords, features_3d = self.cylinder_3d_generator(train_pt_fea_ten, train_vox_ten)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/working_dir/cylindernet/network/cylinder_fea_generator.py", line 68, in forward
    shuffled_ind = torch.randperm(pt_num, device=cur_dev)
RuntimeError: Device index must not be negative
  0%|

If I manually set cur_dev to None I get this error:

root@f125ceb56018:/working_dir# python -m cylindernet.train_cylinder_asym
/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:52: UserWarning: CUDA initialization: Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx (Triggered internally at  /pytorch/c10/cuda/CUDAFunctions.cpp:100.)
  return torch._C._cuda_getDeviceCount() > 0
/working_dir/cylindernet/train_cylinder_asym.py
[480 360  32]
  0%|                                                                                                                 | 0/502 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/working_dir/cylindernet/train_cylinder_asym.py", line 167, in <module>
    main(args)
  File "/working_dir/cylindernet/train_cylinder_asym.py", line 83, in main
    for i_iter, (_, train_vox_label, train_grid, _, train_pt_fea) in enumerate(train_dataset_loader):
  File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 435, in __next__
    data = self._next_data()
  File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/dataloader.py", line 475, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/usr/local/lib/python3.8/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/working_dir/cylindernet/dataloader/dataset_semantickitti.py", line 197, in __getitem__
    data = self.point_cloud_dataset[index]
  File "/working_dir/cylindernet/dataloader/pc_dataset.py", line 56, in __getitem__
    raw_data = np.fromfile(self.im_idx[index], dtype=np.float32).reshape((-1, 4))
ValueError: cannot reshape array of size 8193 into shape (4)
xinge008 commented 3 years ago

Which dataset do you use? SemanticKITTI and nuScenes dataset are supported via `np.fromfile(self.im_idx[index], dtype=np.float32).reshape((-1, 4))'

FrancescoMandru commented 3 years ago

Solved it, apparently there was a corrupted file