open-mmlab / mmdetection3d

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

[Bug] module 'numpy' has no attribute 'long' #2821

Open ClementLeBihan opened 9 months ago

ClementLeBihan commented 9 months ago

Prerequisite

Task

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

Branch

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

Environment

sys.platform: linux Python: 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0] CUDA available: True numpy_random_seed: 2147483648 GPU 0: NVIDIA RTX A3000 Laptop GPU CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.3, V11.3.109 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.11.0 PyTorch compiling details: PyTorch built with:

TorchVision: 0.12.0 OpenCV: 4.8.1 MMEngine: 0.10.1 MMDetection: 3.2.0 MMDetection3D: 1.3.0+ spconv2.0: False

Reproduces the problem - code sample

python tools/train.py configs/benchmark/hv_pointpillars_secfpn_3x8_100e_det3d_kitti-3d-car.py

Reproduces the problem - command or script

python tools/train.py configs/benchmark/hv_pointpillars_secfpn_3x8_100e_det3d_kitti-3d-car.py

Reproduces the problem - error message

Original Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/conda/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/conda/lib/python3.8/site-packages/mmengine/dataset/dataset_wrapper.py", line 290, in getitem return self.dataset[sample_idx] File "/opt/conda/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 410, in getitem data = self.prepare_data(idx) File "/mmdetection3d/mmdet3d/datasets/det3d_dataset.py", line 386, in prepare_data example = self.pipeline(input_dict) File "/opt/conda/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 60, in call data = t(data) File "/opt/conda/lib/python3.8/site-packages/mmcv/transforms/base.py", line 12, in call return self.transform(results) File "/mmdetection3d/mmdet3d/datasets/transforms/transforms_3d.py", line 424, in transform sampled_dict = self.db_sampler.sample_all( File "/mmdetection3d/mmdet3d/datasets/transforms/dbsampler.py", line 283, in sample_all dtype=np.long) File "/opt/conda/lib/python3.8/site-packages/numpy/init.py", line 320, in getattr raise AttributeError("module {!r} has no attribute " AttributeError: module 'numpy' has no attribute 'long'

Additional information

I'm using the default dockerfile. Adding pip install numpy==1.22 solve the problem.

yangfengyuan1 commented 4 months ago

i meet the same problem, have you solved?

AbdelrahmanAbdeldaim commented 3 months ago

pip install --upgrade numba solved the problem for me. @yangfengyuan1

xiaowang968 commented 2 months ago

pip install numba==0.55.2 solved the problem for me.