fundamentalvision / BEVFormer

[ECCV 2022] This is the official implementation of BEVFormer, a camera-only framework for autonomous driving perception, e.g., 3D object detection and semantic map segmentation.
https://arxiv.org/abs/2203.17270
Apache License 2.0
3.33k stars 543 forks source link

ImportError: cannot import name 'ball_query_ext' from partially initialized module 'mmdet3d.ops.ball_query' #155

Open GoroYeh56 opened 1 year ago

GoroYeh56 commented 1 year ago

I got this error when running python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0 --canbus ./data

(open-mmlab) goroyeh56@Goros-MacBook-Air mmdetection3d % python3 tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0 --canbus ./data
Traceback (most recent call last):
  File "tools/create_data.py", line 6, in <module>
    from tools.data_converter import kitti_converter as kitti
  File "/Users/goroyeh56/mmdetection3d/tools/data_converter/kitti_converter.py", line 8, in <module>
    from mmdet3d.core.bbox import box_np_ops
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/core/__init__.py", line 3, in <module>
    from .bbox import *  # noqa: F401, F403
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/core/bbox/__init__.py", line 5, in <module>
    from .iou_calculators import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D,
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/core/bbox/iou_calculators/__init__.py", line 2, in <module>
    from .iou3d_calculator import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D,
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py", line 6, in <module>
    from ..structures import get_box_type
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/core/bbox/structures/__init__.py", line 2, in <module>
    from .base_box3d import BaseInstance3DBoxes
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/core/bbox/structures/base_box3d.py", line 6, in <module>
    from mmdet3d.ops.iou3d import iou3d_cuda
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/ops/__init__.py", line 6, in <module>
    from .ball_query import ball_query
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/ops/ball_query/__init__.py", line 1, in <module>
    from .ball_query import ball_query
  File "/Users/goroyeh56/mmdetection3d/mmdet3d/ops/ball_query/ball_query.py", line 4, in <module>
    from . import ball_query_ext
ImportError: cannot import name 'ball_query_ext' from partially initialized module 'mmdet3d.ops.ball_query' (most likely due to a circular import) (/Users/goroyeh56/mmdetection3d/mmdet3d/ops/ball_query/__init__.py)
(open-mmlab) goroyeh56@Goros-MacBook-Air mmdetection3d 

Anyone knows how to resolve this? Thank you!

YoushaaMurhij commented 1 year ago

I have the same problem. It's related to the version of mmdet-3d and mmcv Could you please provide a suggestion? Thanks

LadissonLai commented 1 year ago

@whai362 Thanks for your awesome work. I also meet the problem. I install mmdetection3d following this official install tutorial [https://github.com/fundamentalvision/BEVFormer/blob/master/docs/install.md], mmcv-full = 1.4.0 , mmdet = 2.14.0 mmsegmentation = 0.14.1 mmdet3d = v0.17.1 I install all the requirement without error, but I meet the bug. the same as the issue. when i run the Prepare nuScenes Data , i got the error. python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenes --version v1.0 -mini --canbus ./data the error info is as follows. Traceback (most recent call last): File "tools/create_data.py", line 6, in <module> from data_converter.create_gt_database import create_groundtruth_database File "/home/ubt2t/AL/BEVFormer/tools/data_converter/create_gt_database.py", line 11, in <module> from mmdet3d.core.bbox import box_np_ops as box_np_ops File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/core/__init__.py", line 3, in <module> from .bbox import * # noqa: F401, F403 File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/core/bbox/__init__.py", line 5, in <module> from .iou_calculators import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D, File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/core/bbox/iou_calculators/__init__.py", line 2, in <module> from .iou3d_calculator import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D, File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py", line 6, in <module> from ..structures import get_box_type File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/core/bbox/structures/__init__.py", line 2, in <module> from .base_box3d import BaseInstance3DBoxes File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/core/bbox/structures/base_box3d.py", line 6, in <module> from mmdet3d.ops.iou3d import iou3d_cuda File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/ops/__init__.py", line 6, in <module> from .ball_query import ball_query File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/ops/ball_query/__init__.py", line 1, in <module> from .ball_query import ball_query File "/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/ops/ball_query/ball_query.py", line 4, in <module> from . import ball_query_ext ImportError: cannot import name 'ball_query_ext' from partially initialized module 'mmdet3d.ops.ball_query' (most likely due to a circular import) (/home/ubt2t/AL/BEVFormer/mmdetection3d/mmdet3d/ops/ball_query/__init__.py)

Thanks your reply , Sincerely!!

samueleruffino99 commented 7 months ago

Same problem here!