open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.02k stars 9.36k forks source link

AssertionError: fused_bias_leakyrelu miss in module _ext #7536

Closed lpkoh closed 2 years ago

lpkoh commented 2 years ago

I am running Ubuntu 18.04. I have installed mmcv==1.3.3, mmdet==2.7.0, using openmim.

I face the following issue when importing from mmdet.core

Traceback (most recent call last):
  File "tools/scrfd2onnx.py", line 10, in <module>
    from mmdet.core import (build_model_from_cfg, generate_inputs_and_wrap_model,
  File "/home/va/Desktop/scrfd/mmdet/core/__init__.py", line 2, in <module>
    from .bbox import *  # noqa: F401, F403
  File "/home/va/Desktop/scrfd/mmdet/core/bbox/__init__.py", line 7, in <module>
    from .samplers import (BaseSampler, CombinedSampler,
  File "/home/va/Desktop/scrfd/mmdet/core/bbox/samplers/__init__.py", line 9, in <module>
    from .score_hlr_sampler import ScoreHLRSampler
  File "/home/va/Desktop/scrfd/mmdet/core/bbox/samplers/score_hlr_sampler.py", line 2, in <module>
    from mmcv.ops import nms_match
  File "/home/va/Desktop/scrfd/venv/lib/python3.6/site-packages/mmcv/ops/__init__.py", line 15, in <module>
    from .fused_bias_leakyrelu import FusedBiasLeakyReLU, fused_bias_leakyrelu
  File "/home/va/Desktop/scrfd/venv/lib/python3.6/site-packages/mmcv/ops/fused_bias_leakyrelu.py", line 10, in <module>
    ext_module = ext_loader.load_ext('_ext', ['fused_bias_leakyrelu'])
  File "/home/va/Desktop/scrfd/venv/lib/python3.6/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
    assert hasattr(ext, fun), f'{fun} miss in module {name}'
AssertionError: fused_bias_leakyrelu miss in module _ext

Could someone advise?

chhluo commented 2 years ago

Please run python mmdet/utils/collect_env.py, and paste all information here.

lpkoh commented 2 years ago

Hi, I have run it and this is my result:

image

I tried running with "python" instead of "python3" instead, same result.

If it helps, I am currently using a Jetson AGX Xavier flashed with Jetpack 4.6. I am using python 3.6.9 in venv. I have installed:

I installed in the above order first. After that, I ran the following commands:

pip install -r requirements/build.txt
pip install -v -e .

as per https://github.com/deepinsight/insightface/tree/master/detection/scrfd

chhluo commented 2 years ago

It seems that mmcv-full was installed improperly .which command did you use to install mmcv?

lpkoh commented 2 years ago

I might have used mmcv==1.3.3 instead of mmcv-full==1.3.3.

I am retrying installation with mmcv-full right now. Could this be the reason?

lpkoh commented 2 years ago

Hi, I have reinstalled my mmcv-full.

I ran python3 mmdet/utils/collect_env.py, and this is what I got: image

I ran the command python3 tools/scrfd2onnx.py config configs/scrfd/scrfd_2.5g.py checkpoint pytorch\ weights/scfrd_2-5g.pth --input-img 0.jpg --shape 640 from https://github.com/deepinsight/insightface/tree/master/detection/scrfd and had the following issue when importing from mmdet.core: image

chhluo commented 2 years ago

Refer to this https://mmdetection.readthedocs.io/en/latest/faq.html#mmcv-installation

ZwwWayne commented 2 years ago

Resolved in MMCV's documentation.