Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import name 'ball_query_ext' with official Docker environment #503

Closed
Dinghow opened this issue Apr 29, 2021 · 5 comments
Closed

Comments

@Dinghow
Copy link

Dinghow commented Apr 29, 2021

Hi,

I successfully built the environment from your official Dockfile

ARG PYTORCH="1.6.0"
ARG CUDA="10.1"
ARG CUDNN="7"

FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel

ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0+PTX"
ENV TORCH_NVCC_FLAGS="-Xfatbin -compress-all"
ENV CMAKE_PREFIX_PATH="$(dirname $(which conda))/../"

RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Install MMCV
RUN pip install mmcv-full==latest+torch1.6.0+cu101 -f https://openmmlab.oss-accelerate.aliyuncs.com/mmcv/dist/index.html
RUN pip install mmdet

# Install MMDetection
RUN conda clean --all
RUN git clone https://github.com/open-mmlab/mmdetection3d.git /mmdetection3d
WORKDIR /mmdetection3d
ENV FORCE_CUDA="1"
RUN pip install -r requirements/build.txt
RUN pip install --no-cache-dir -e .

# uninstall pycocotools installed by nuscenes-devkit and reinstall mmpycocotools
RUN pip uninstall pycocotools --no-cache-dir -y
RUN pip install mmpycocotools --no-cache-dir --force --no-deps
RUN pip install tensorboard

image

And I can successfully execute inference with your pre-trained model. However, when I try training with instruction ./tools/dist_train.sh configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py 4, there will raise errors:

Traceback (most recent call last):
4/28/2021 10:06:37 PM File "./tools/train.py", line 16, in
4/28/2021 10:06:37 PM from mmdet3d.datasets import build_dataset
4/28/2021 10:06:37 PM File "/output/mmdet3d/datasets/init.py", line 3, in
4/28/2021 10:06:37 PM from .custom_3d import Custom3DDataset
4/28/2021 10:06:37 PM File "/output/mmdet3d/datasets/custom_3d.py", line 9, in
4/28/2021 10:06:37 PM from ..core.bbox import get_box_type
4/28/2021 10:06:37 PM File "/output/mmdet3d/core/init.py", line 2, in
4/28/2021 10:06:37 PM from .bbox import * # noqa: F401, F403
4/28/2021 10:06:37 PM File "/output/mmdet3d/core/bbox/init.py", line 4, in
4/28/2021 10:06:37 PM from .iou_calculators import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D,
4/28/2021 10:06:37 PM File "/output/mmdet3d/core/bbox/iou_calculators/init.py", line 1, in
4/28/2021 10:06:37 PM from .iou3d_calculator import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D,
4/28/2021 10:06:37 PM File "/output/mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py", line 5, in
4/28/2021 10:06:37 PM from ..structures import get_box_type
4/28/2021 10:06:37 PM File "/output/mmdet3d/core/bbox/structures/init.py", line 1, in
4/28/2021 10:06:37 PM from .base_box3d import BaseInstance3DBoxes
4/28/2021 10:06:37 PM File "/output/mmdet3d/core/bbox/structures/base_box3d.py", line 5, in
4/28/2021 10:06:37 PM from mmdet3d.ops.iou3d import iou3d_cuda
4/28/2021 10:06:37 PM File "/output/mmdet3d/ops/init.py", line 5, in
4/28/2021 10:06:37 PM from .ball_query import ball_query
4/28/2021 10:06:37 PM File "/output/mmdet3d/ops/ball_query/init.py", line 1, in
4/28/2021 10:06:37 PM from .ball_query import ball_query
4/28/2021 10:06:37 PM File "/output/mmdet3d/ops/ball_query/ball_query.py", line 4, in
4/28/2021 10:06:37 PM from . import ball_query_ext
4/28/2021 10:06:37 PM ImportError: cannot import name 'ball_query_ext' from 'mmdet3d.ops.ball_query' (/output/mmdet3d/ops/ball_query/init.py)
4/28/2021 10:06:38 PM Traceback (most recent call last):
4/28/2021 10:06:38 PM File "./tools/train.py", line 16, in
4/28/2021 10:06:38 PM from mmdet3d.datasets import build_dataset
4/28/2021 10:06:38 PM File "/output/mmdet3d/datasets/init.py", line 3, in
4/28/2021 10:06:38 PM from .custom_3d import Custom3DDataset
4/28/2021 10:06:38 PM File "/output/mmdet3d/datasets/custom_3d.py", line 9, in
4/28/2021 10:06:38 PM from ..core.bbox import get_box_type
4/28/2021 10:06:38 PM File "/output/mmdet3d/core/init.py", line 2, in
4/28/2021 10:06:38 PM from .bbox import * # noqa: F401, F403
4/28/2021 10:06:38 PM File "/output/mmdet3d/core/bbox/init.py", line 4, in
4/28/2021 10:06:38 PM from .iou_calculators import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D,
4/28/2021 10:06:38 PM File "/output/mmdet3d/core/bbox/iou_calculators/init.py", line 1, in
4/28/2021 10:06:38 PM from .iou3d_calculator import (AxisAlignedBboxOverlaps3D, BboxOverlaps3D,
4/28/2021 10:06:38 PM File "/output/mmdet3d/core/bbox/iou_calculators/iou3d_calculator.py", line 5, in
4/28/2021 10:06:38 PM from ..structures import get_box_type
4/28/2021 10:06:38 PM File "/output/mmdet3d/core/bbox/structures/init.py", line 1, in
4/28/2021 10:06:38 PM from .base_box3d import BaseInstance3DBoxes
4/28/2021 10:06:38 PM File "/output/mmdet3d/core/bbox/structures/base_box3d.py", line 5, in
4/28/2021 10:06:38 PM from mmdet3d.ops.iou3d import iou3d_cuda
4/28/2021 10:06:38 PM File "/output/mmdet3d/ops/init.py", line 5, in
4/28/2021 10:06:38 PM from .ball_query import ball_query
4/28/2021 10:06:38 PM File "/output/mmdet3d/ops/ball_query/init.py", line 1, in
4/28/2021 10:06:38 PM from .ball_query import ball_query
4/28/2021 10:06:38 PM File "/output/mmdet3d/ops/ball_query/ball_query.py", line 4, in
4/28/2021 10:06:38 PM from . import ball_query_ext
4/28/2021 10:06:38 PM ImportError: cannot import name 'ball_query_ext' from 'mmdet3d.ops.ball_query' (/output/mmdet3d/ops/ball_query/init.py)
4/28/2021 10:06:38 PM Traceback (most recent call last):
4/28/2021 10:06:38 PM File "/opt/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
4/28/2021 10:06:38 PM "main", mod_spec)
4/28/2021 10:06:38 PM File "/opt/conda/lib/python3.7/runpy.py", line 85, in _run_code
4/28/2021 10:06:38 PM exec(code, run_globals)
4/28/2021 10:06:38 PM File "/opt/conda/lib/python3.7/site-packages/torch/distributed/launch.py", line 261, in
4/28/2021 10:06:38 PM main()
4/28/2021 10:06:38 PM File "/opt/conda/lib/python3.7/site-packages/torch/distributed/launch.py", line 257, in main
4/28/2021 10:06:38 PM cmd=cmd)
4/28/2021 10:06:38 PM subprocess.CalledProcessError: Command '['/opt/conda/bin/python', '-u', './tools/train.py', '--local_rank=3', 'configs/pointpillars/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py', '--launcher', 'pytorch']' returned non-zero exit status 1.
4/28/2021 10:06:38 PM *****************************************
4/28/2021 10:06:38 PM Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.

Could you please give me some suggestion?
Sincerely thanks!

@Wuziyi616
Copy link
Contributor

I am not very familiar with docker. Can you run python mmdet3d/utils/collect_env.py to let us know your environment settings? And can you re-compile mmdet3d (I guess remove this one and re-install another) and show us the output information?

@Dinghow
Copy link
Author

Dinghow commented Apr 29, 2021

I am not very familiar with docker. Can you run python mmdet3d/utils/collect_env.py to let us know your environment settings? And can you re-compile mmdet3d (I guess remove this one and re-install another) and show us the output information?

Sure, the environment in my docker:

sys.platform: linux
4/29/2021 3:23:47 PM Python: 3.7.7 (default, May 7 2020, 21:25:33) [GCC 7.3.0]
4/29/2021 3:23:47 PM CUDA available: True
4/29/2021 3:23:47 PM GPU 0: Tesla V100-SXM2-32GB
4/29/2021 3:23:47 PM CUDA_HOME: /usr/local/cuda
4/29/2021 3:23:47 PM NVCC: Cuda compilation tools, release 10.1, V10.1.243
4/29/2021 3:23:47 PM GCC: gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
4/29/2021 3:23:47 PM PyTorch: 1.6.0
4/29/2021 3:23:47 PM PyTorch compiling details: PyTorch built with:
4/29/2021 3:23:47 PM - GCC 7.3
4/29/2021 3:23:47 PM - C++ Version: 201402
4/29/2021 3:23:47 PM - Intel(R) Math Kernel Library Version 2020.0.1 Product Build 20200208 for Intel(R) 64 architecture applications
4/29/2021 3:23:47 PM - Intel(R) MKL-DNN v1.5.0 (Git Hash e2ac1fac44c5078ca927cb9b90e1b3066a0b2ed0)
4/29/2021 3:23:47 PM - OpenMP 201511 (a.k.a. OpenMP 4.5)
4/29/2021 3:23:47 PM - NNPACK is enabled
4/29/2021 3:23:47 PM - CPU capability usage: AVX2
4/29/2021 3:23:47 PM - CUDA Runtime 10.1
4/29/2021 3:23:47 PM - 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_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
4/29/2021 3:23:47 PM - CuDNN 7.6.3
4/29/2021 3:23:47 PM - Magma 2.5.2
4/29/2021 3:23:47 PM - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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-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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=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, USE_STATIC_DISPATCH=OFF,
4/29/2021 3:23:47 PM
4/29/2021 3:23:47 PM TorchVision: 0.7.0
4/29/2021 3:23:47 PM OpenCV: 4.5.1
4/29/2021 3:23:47 PM MMCV: 1.3.1
4/29/2021 3:23:47 PM MMCV Compiler: GCC 7.3
4/29/2021 3:23:47 PM MMCV CUDA Compiler: 10.1
4/29/2021 3:23:47 PM MMDetection: 2.11.0
4/29/2021 3:23:47 PM MMDetection3D: 0.12.0+f7356f4

Thanks for your immediate reply, and I wonder if you update your Dockerfile in time (I notice the last update is 7 month ago), maybe it's out of date? Have you validate the docker environment?

Sincerely thanks!

@Dinghow Dinghow closed this as completed Apr 30, 2021
@Dinghow
Copy link
Author

Dinghow commented Apr 30, 2021

The issue is closed, since we find the official Dockerfile is right, and it happens due to our configuration of our train platform.

Thanks for your help!

@zhyever
Copy link

zhyever commented May 25, 2021

The issue is closed, since we find the official Dockerfile is right, and it happens due to our configuration of our train platform.

Thanks for your help!

hi, I meet the same problem. Can you share the configuration?

@Dinghow
Copy link
Author

Dinghow commented May 25, 2021

The issue is closed, since we find the official Dockerfile is right, and it happens due to our configuration of our train platform.
Thanks for your help!

hi, I meet the same problem. Can you share the configuration?

Hello, I met this problem because we deployed a docker environment with mmdet3d offical dockerfile, but we run the code mounted on docker without building, and we solve it by building mounted mmdet3d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants