一、问题现象(附报错日志上下文):
BEVDet训练报错:
ImportError: cannot import name 'bev_pool_v3' from 'mx_driving.point'
二、软件版本:
-- CANN 版本: RC3
-- torch版本: 2.1.0
-- torch-npu版本: 2.1.0.post6
-- Python 版本: 3.8
-- 操作系统版本: Ubuntu 20.04
**PS: 能否在Readme提供一下BEVDet使用的具体CANN版本(8.0 rc3 or rc4),python版本,mx_driving使用的分支等具体信息**
三、测试步骤:
1、下载 mx_driving (branch_v6.0.0-RC3)编译,出现上述错误
```
git clone -b branch_v6.0.0-RC3 https://gitee.com/ascend/mxDriving.git
pip install -r requirements.txt
将CMakePresets.json中的ENABLE_ONNX选项改为FALSE
umask 0027
bash ci/build.sh --python=3.8
pip install mx_driving-1.0.0+git{commit_id}-cp{python_version}-linux_{arch}.whl
```
2、切换分支,编译 mx_driving (branch_v6.0.0) 出现同样错误
git clone -b branch_v6.0.0 https://gitee.com/ascend/mxDriving.git
四、日志信息:
```
root@huabei-2-npu:/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet# bash ./test/train_1p.sh --py_config=configs/bevdet/bevdet-r50.py
device id is 0
2024-12-31 15:45:48.422 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=0.
2024-12-31 15:45:48.562 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=1.
2024-12-31 15:45:48.699 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=2.
2024-12-31 15:45:48.832 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=3.
2024-12-31 15:45:48.965 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=4.
2024-12-31 15:45:49.097 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=5.
2024-12-31 15:45:49.234 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=6.
2024-12-31 15:45:49.367 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(0)[ERROR], device id=7.
2024-12-31 15:45:49.382 [MSNPUREPORT][INFO] Set device log level success! log level string=SetLogLevel(2)[DISABLE], device id=0.
Device ID: 0
/usr/local/lib/python3.8/dist-packages/mmcv_full-1.7.2-py3.8-linux-aarch64.egg/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
warnings.warn(
/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/core/evaluation/kitti_utils/eval.py:10: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
def get_thresholds(scores: np.ndarray, num_gt, num_sample_pts=41):
Traceback (most recent call last):
File "./tools/train.py", line 32, in <module>
from mmdet3d.apis import init_random_seed, train_model
File "/data/Device ID: 0
/usr/local/lib/python3.8/dist-packages/mmcv_full-1.7.2-py3.8-linux-aarch64.egg/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
warnings.warn(
/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/core/evaluation/kitti_utils/eval.py:10: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
def get_thresholds(scores: np.ndarray, num_gt, num_sample_pts=41):
Traceback (most recent call last):
File "./tools/train.py", line 32, in <module>
from mmdet3d.apis import init_random_seed, train_model
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/apis/__init__.py", line 2, in <module>
from .inference import (convert_SyncBN, inference_detector,
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/apis/inference.py", line 18, in <module>
from mmdet3d.models import build_model
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/models/__init__.py", line 17, in <module>
from .necks import * # noqa: F401,F403
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/models/necks/__init__.py", line 9, in <module>
from .view_transformer import LSSViewTransformer, LSSViewTransformerBEVDepth, \
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/models/necks/view_transformer.py", line 24, in <module>
from mx_driving.point import bev_pool_v3
ImportError: cannot import name 'bev_pool_v3' from 'mx_driving.point' (/usr/local/lib/python3.8/dist-packages/mx_driving/point/__init__.py)
[ERROR] 2024-12-31-15:29:30 (PID:158628, Device:-1, RankID:-1) ERR99999 UNKNOWN application exception
[2024-12-31 15:29:34,147] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 158628) of binary: /usr/bin/python
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 "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 810, in <module>
main()
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 806, in main
run(args)
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 797, in run
elastic_launch(
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launcher/api.py", line 134, in __call__
return launch_agent(self._config, self._entrypoint, list(args))
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launcher/api.py", line 264, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
./tools/train.py FAILED
------------------------------------------------------------
Failures:
<NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
time : 2024-12-31_15:29:34
host : huabei-2-npu.10.240.48.74
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 158628)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================
find: ‘output/train_1p/bevdet-r50’: No such file or directory
------------------ Final result ------------------/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/apis/__init__.py", line 2, in <module>
from .inference import (convert_SyncBN, inference_detector,
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/apis/inference.py", line 18, in <module>
from mmdet3d.models import build_model
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/models/__init__.py", line 17, in <module>
from .necks import * # noqa: F401,F403
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/models/necks/__init__.py", line 9, in <module>
from .view_transformer import LSSViewTransformer, LSSViewTransformerBEVDepth, \
File "/data/user/AutoDrive/BEVDet/mxDriving/model_examples/BEVDet/mmdet3d/models/necks/view_transformer.py", line 24, in <module>
from mx_driving.point import bev_pool_v3
ImportError: cannot import name 'bev_pool_v3' from 'mx_driving.point' (/usr/local/lib/python3.8/dist-packages/mx_driving/point/__init__.py)
[ERROR] 2024-12-31-15:29:30 (PID:158628, Device:-1, RankID:-1) ERR99999 UNKNOWN application exception
[2024-12-31 15:29:34,147] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 158628) of binary: /usr/bin/python
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 "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 810, in <module>
main()
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 346, in wrapper
return f(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 806, in main
run(args)
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/run.py", line 797, in run
elastic_launch(
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launcher/api.py", line 134, in __call__
return launch_agent(self._config, self._entrypoint, list(args))
File "/usr/local/lib/python3.8/dist-packages/torch/distributed/launcher/api.py", line 264, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
============================================================
./tools/train.py FAILED
------------------------------------------------------------
Failures:
<NO_OTHER_FAILURES>
------------------------------------------------------------
Root Cause (first observed failure):
[0]:
time : 2024-12-31_15:29:34
host : huabei-2-npu.10.240.48.74
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 158628)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
============================================================
find: ‘output/train_1p/bevdet-r50’: No such file or directory
------------------ Final result ------------------
```