open-mmlab / mmaction2

OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
https://mmaction2.readthedocs.io
Apache License 2.0
4.31k stars 1.25k forks source link

[Bug] KeyError: 'Cannot find None in registry under scope name mmengine' #2595

Open zhaoyuan-he opened 1 year ago

zhaoyuan-he commented 1 year ago

Branch

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

Prerequisite

Environment

sys.platform: linux Python: 3.8.17 (default, Jul 5 2023, 21:04:15) [GCC 11.2.0] CUDA available: True numpy_random_seed: 2147483648 GPU 0: NVIDIA GeForce RTX 3080 CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 11.6, V11.6.124 GCC: gcc (Ubuntu 7.5.0-6ubuntu2) 7.5.0 PyTorch: 1.13.1+cu116 PyTorch compiling details: PyTorch built with:

TorchVision: 0.14.1+cu116 OpenCV: 4.8.0 MMEngine: 0.8.2 MMAction2: 1.1.0+f2637ee MMCV: 2.0.1

Describe the bug

Cannot find ConvAudio when running test_resnet_audio_backbone() in test_resnet_audio.py. Looks like ConvAudio is not correctly registered.

Reproduces the problem - code sample

python mmaction/testing/_test_resnet_audio.py

Reproduces the problem - command or script

No response

Reproduces the problem - error message

Traceback (most recent call last):
  File "tests/models/backbones/test_resnet_audio.py", line 19, in <module>
    test_resnet_audio_backbone()
  File "tests/models/backbones/test_resnet_audio.py", line 13, in test_resnet_audio_backbone
    audioonly = ResNetAudio(50, None)
  File "/home/zyhe/Documents/Video_audio/mmaction2/mmaction/models/backbones/resnet_audio.py", line 216, in __init__
    self._make_stem_layer()
  File "/home/zyhe/Documents/Video_audio/mmaction2/mmaction/models/backbones/resnet_audio.py", line 316, in _make_stem_layer
    self.conv1 = ConvModule(
  File "/home/changhan/anaconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/cnn/bricks/conv_module.py", line 171, in __init__
    self.conv = build_conv_layer(
  File "/home/changhan/anaconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/cnn/bricks/conv.py", line 47, in build_conv_layer
    raise KeyError(f'Cannot find {conv_layer} in registry under scope '
KeyError: 'Cannot find None in registry under scope name mmengine'

Additional information

No response

cir7 commented 1 year ago

Thanks for your feedback, it seems that a bug in the ut. We have fixed the bug in https://github.com/open-mmlab/mmaction2/pull/2637, you may have a check.