[Bug] ModuleNotFoundError: No module named 'tools.data_converter'
Prerequisite
- I have searched Issues and Discussions but cannot get the expected help.
- I have read the FAQ documentation but cannot get the expected help.
- The bug has not been fixed in the latest version (dev) or latest version (1.x).
Task
I have modified the scripts/configs, or I'm working on my own tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmdetection3d
Environment
Python: 3.6.12 (default, Dec 9 2022, 16:54:45) [GCC 7.5.0] CUDA available: False GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.9.0 PyTorch compiling details: PyTorch built with:
- GCC 7.3
- C++ Version: 201402
- Intel(R) MKL-DNN v2.1.2 (Git Hash 574ab98256e4b94b681a1413363fd82aef4619f2)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- NNPACK is enabled
- CPU capability usage: AVX2
- Build settings: BLAS_INFO=open, BUILD_TYPE=Release, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++, CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 -D_GLIBCXX_USE_CXX11_ABI=0 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -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, FORCE_FALLBACK_CUDA_MPI=1, LAPACK_INFO=open, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.9.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=ON, USE_MPI=ON, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=ON,
TorchVision: 0.10.0a0+300a8a4 OpenCV: 4.7.0 MMCV: 1.7.1 MMCV Compiler: GCC 7.5 MMCV CUDA Compiler: not available MMDetection: 2.26.0 MMSegmentation: 0.29.1 MMDetection3D: 1.0.0rc7+b3c990a spconv2.0: False
Reproduces the problem - code sample
none
Reproduces the problem - command or script
python tools/create_data.py nuscenes --root-path ./data/nuscenes --out-dir ./data/nuscenes --extra-tag nuscenesReproduces the problem - error message
Traceback (most recent call last): File "tools/create_data.py", line 5, in from tools.data_converter import indoor_converter as indoor ModuleNotFoundError: No module named 'tools.data_converter'
Additional information
i'm using the dev branch, and when i change the following two files like below, then it works fine. i don't know if this is a bug of the python script. Thanks for any advice.
diff --git a/tools/create_data.py b/tools/create_data.py index 32337d1a..1c3efd74 100644 --- a/tools/create_data.py +++ b/tools/create_data.py @@ -2,14 +2,13 @@ import argparse from os import path as osp
-from tools.data_converter import indoor_converter as indoor -from tools.data_converter import kitti_converter as kitti -from tools.data_converter import lyft_converter as lyft_converter -from tools.data_converter import nuscenes_converter as nuscenes_converter -from tools.data_converter.create_gt_database import ( +from data_converter import indoor_converter as indoor +from data_converter import kitti_converter as kitti +from data_converter import lyft_converter as lyft_converter +from data_converter import nuscenes_converter as nuscenes_converter +from data_converter.create_gt_database import ( GTDatabaseCreater, create_groundtruth_database)
diff --git a/tools/data_converter/indoor_converter.py b/tools/data_converter/indoor_converter.py index ee6c0387..3c2dfa5f 100644 --- a/tools/data_converter/indoor_converter.py +++ b/tools/data_converter/indoor_converter.py @@ -4,9 +4,9 @@ import os import mmcv import numpy as np
-from tools.data_converter.s3dis_data_utils import S3DISData, S3DISSegData -from tools.data_converter.scannet_data_utils import ScanNetData, ScanNetSegData -from tools.data_converter.sunrgbd_data_utils import SUNRGBDData +from data_converter.s3dis_data_utils import S3DISData, S3DISSegData +from data_converter.scannet_data_utils import ScanNetData, ScanNetSegData +from data_converter.sunrgbd_data_utils import SUNRGBDData
Source: open-mmlab/mmdetection3d