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

ImportError: cannot import name 'build' #8

Closed
Enerald opened this issue Oct 11, 2021 · 2 comments
Closed

ImportError: cannot import name 'build' #8

Enerald opened this issue Oct 11, 2021 · 2 comments

Comments

@Enerald
Copy link

Enerald commented Oct 11, 2021

Hi, developers of BRNet. I have installed BRNet following the getting_started.md. All prerequisites and their corresponding version are meet the requirements. (python==3.6.9 cuda==10.1 pytorch==1.5.0 torchvision==0.6.0 mmcv==1.3.14 mmdet==2.17.0 mmdet3d==0.17.0)

  1. But when I run the train.py, I get error like this:

Traceback (most recent call last):
File "tools/train.py", line 212, in
main()
File "tools/train.py", line 176, in main
test_cfg=cfg.get('test_cfg'))
File "/home/BRNet/mmdetection3d/mmdet3d/models/builder.py", line 58, in build_detector
cfg, default_args=dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/home/BRNet/mmcv/mmcv/utils/registry.py", line 212, in build
return self.build_func(*args, **kwargs, registry=self)
File "/home/BRNet/mmcv/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/home/BRNet/mmcv/mmcv/utils/registry.py", line 45, in build_from_cfg
f'{obj_type} is not in the {registry.name} registry')
KeyError: 'BRNet is not in the models registry'

  1. And when I test the installation by "from mmdet3d.apis import init_detector, inference_detector", I get error like this:

Traceback (most recent call last):
File "", line 1, in
File "/home/BRNet/mmdet3d/apis/init.py", line 1, in
from .inference import inference_detector, init_detector, show_result_meshlab
File "/home/BRNet/mmdet3d/apis/inference.py", line 11, in
from mmdet3d.models import build_detector
File "/home/BRNet/mmdet3d/models/init.py", line 1, in
from .backbones import * # noqa: F401,F403
File "/home/BRNet/mmdet3d/models/backbones/init.py", line 3, in
from .nostem_regnet import NoStemRegNet
File "/home/BRNet/mmdet3d/models/backbones/nostem_regnet.py", line 2, in
from ..builder import BACKBONES
File "/home/BRNet/mmdet3d/models/builder.py", line 3, in
from mmdet.models.builder import (BACKBONES, DETECTORS, HEADS, LOSSES, NECKS,
ImportError: cannot import name 'build'

Thanks for your help if you know how to install BRNet to avoid these problem.

@cheng052
Copy link
Owner

You may refer to this issue.
#5
You should take care of the version of mmdet and mmdet3d, mmdet==2.10.0 and mmdet3d==0.11.0 are recommended.
Newer versions of mmdet and mmdet3d will bring some bugs due to code changes.

@Enerald
Copy link
Author

Enerald commented Oct 21, 2021

Thank you~

@Enerald Enerald closed this as completed Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants