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

[Bug] ModuleNotFoundError: No module named 'mmaction.models.localizers.drn' #2714

Open
3 tasks done
dummyindex opened this issue Oct 19, 2023 · 11 comments · May be fixed by #2721
Open
3 tasks done

[Bug] ModuleNotFoundError: No module named 'mmaction.models.localizers.drn' #2714

dummyindex opened this issue Oct 19, 2023 · 11 comments · May be fixed by #2721
Assignees

Comments

@dummyindex
Copy link

dummyindex commented Oct 19, 2023

Branch

main branch (1.x version, such as v1.0.0, or dev-1.x branch)

Prerequisite

Environment

Fresh Anaconda
output of pip freeze | grep mm (filtered other packages with mm substring

mmaction2==1.2.0
mmcv==2.1.0
mmdet==3.2.0
mmengine==0.9.0
mmpose==1.2.0

Describe the bug

An import failure bug. DRN is missing.

Reproduces the problem - code sample

installed on 10/18/2023 via

pip install -U openmim
mim install mmengine
mim install mmcv
mim install mmdet
mim install mmpose
pip install mmaction2
Traceback (most recent call last):
  File "/home/someUser/livecellx/notebooks/scripts/mmdetection_classify/train.py", line 124, in <module>
    main()
  File "/home/someUser/livecellx/notebooks/scripts/mmdetection_classify/train.py", line 117, in main
    runner = Runner.from_cfg(cfg)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/runner/runner.py", line 462, in from_cfg
    runner = cls(
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/runner/runner.py", line 429, in __init__
    self.model = self.build_model(model)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/runner/runner.py", line 836, in build_model
    model = MODELS.build(model)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 232, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 98, in build_from_cfg
    obj_cls = registry.get(obj_type)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/registry/registry.py", line 451, in get
    self.import_from_location()
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmengine/registry/registry.py", line 376, in import_from_location
    import_module(loc)
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmaction/models/__init__.py", line 6, in <module>
    from .localizers import *  # noqa: F401,F403
  File "/home/someUser/anaconda3/envs/livecellx/lib/python3.9/site-packages/mmaction/models/localizers/__init__.py", line 4, in <module>
    from .drn.drn import DRN
ModuleNotFoundError: No module named 'mmaction.models.localizers.drn'

Reproduces the problem - command or script

No response

Reproduces the problem - error message

No response

Additional information

A temporary solution: comment out the DRN part if DRN is not required :).

# Copyright (c) OpenMMLab. All rights reserved.
from .bmn import BMN
from .bsn import PEM, TEM
# from .drn.drn import DRN
from .tcanet import TCANet

__all__ = ['TEM', 'PEM', 'BMN', 'TCANet'] # , 'DRN']

@wsascha
Copy link

wsascha commented Oct 26, 2023

Can confirm.

My guess it's a missing __init__.py in mmaction/models/localizers/drn.

@wsascha wsascha linked a pull request Oct 26, 2023 that will close this issue
@15598003953
Copy link

I had the same problem as you, did you solve it please?

@15598003953
Copy link

.\Anaconda3\envs\mmact2\lib\site-packages\mmaction2-1.2.0-py3.8.egg\mmaction\models\localizers
I found no drn file in this directory, it should need to be added, did you find this file please?

@guidovanschie-nedap
Copy link

Somehow, this directory:
https://github.com/open-mmlab/mmaction2/tree/4d6c93474730cad2f25e51109adcf96824efc7a3/mmaction/models/localizers/drn
did not end up in the pypi package:
https://pypi.org/project/mmaction2/1.2.0/

You can fix this temporarily by copying the dir into your installed mmaction2 package (......./site-packages/mmaction/models/localizers/)

@shekarneo
Copy link

Any fix for this issue?

@farhadi76m
Copy link

I fixed it manually by copying drn folder to AppData\Local\Programs\Python\Python39\Lib\site-packages\mmaction\models\localizers

@Kataglyphis
Copy link

It also occurs when installing from source ...
For now only copying the files into the environment solves it.

Why is there no update ?

@lsewcx
Copy link

lsewcx commented Apr 16, 2024

Somehow, this directory:不知何故,这个目录: https://github.com/open-mmlab/mmaction2/tree/4d6c93474730cad2f25e51109adcf96824efc7a3/mmaction/models/localizers/drn did not end up in the pypi package:没有在pypi包中结束: https://pypi.org/project/mmaction2/1.2.0/不知何故,这个目录:https://github.com/open-mmlab/mmaction2/tree/4d6c93474730cad2f25e51109adcf96824efc7a3/mmaction/models/localizers/drn 没有在pypi软件包中结束:https://pypi.org/project/mmaction2/1.2.0/![](chrome-extension://dppcnmibpgmagiigcnfdjpnghplibbna/images/translator.png)

You can fix this temporarily by copying the dir into your installed mmaction2 package (......./site-packages/mmaction/models/localizers/您可以通过将目录复制到已安装的mmaction 2软件包(......./site-packages/mmaction/models/localizers/)来临时修复此问题)

有用感谢

@SafaTinaztepe
Copy link

Hi I got past this by installing from source. Pip version had this error, but installing local editable version worked for me.

@liuzc188
Copy link

我在 site. package ....路径中 把有关drn的引入包 及后面注释了。

@txy00001
Copy link

txy00001 commented Sep 9, 2024

image
Add it to init
image

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

Successfully merging a pull request may close this issue.