prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  ValueError: FastRCNN is not registered in LOCALIZERS, RECOGNIZERS or DETECTORS
  Hello
  when I train AVA dataset find a error
  ValueError: FastRCNN is not registered in LOCALIZERS, RECOGNIZERS or DETECTORS
  how to solve it 
  think you very much 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `mmaction/models/builder.py`
  Content:
  ```
  1 import torch.nn as nn
  2 from mmcv.utils import Registry, build_from_cfg
  3 
  4 from mmaction.utils import import_module_error_func
  5 from .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS
  6 
  7 try:
  8     from mmdet.models.builder import DETECTORS, build_detector
  9 except (ImportError, ModuleNotFoundError):
  10     # Define an empty registry and building func, so that can import
  11     DETECTORS = Registry('detector')
  12 
  13     @import_module_error_func('mmdet')
  14     def build_detector(cfg, train_cfg, test_cfg):
  15         pass
  16 
  17 
  18 def build(cfg, registry, default_args=None):
  19     """Build a module.
  20 
  21     Args:
  22         cfg (dict, list[dict]): The config of modules, it is either a dict
  23             or a list of configs.
  24         registry (:obj:`Registry`): A registry the module belongs to.
  25         default_args (dict, optional): Default arguments to build the module.
  26             Defaults to None.
  27 
  28     Returns:
  29         nn.Module: A built nn module.
  30     """
  31 
  32     if isinstance(cfg, list):
  33         modules = [
  34             build_from_cfg(cfg_, registry, default_args) for cfg_ in cfg
  35         ]
  36         return nn.Sequential(*modules)
  37 
  38     return build_from_cfg(cfg, registry, default_args)
  39 
  40 
  41 def build_backbone(cfg):
  42     """Build backbone."""
  43     return build(cfg, BACKBONES)
  44 
  45 
  46 def build_head(cfg):
  47     """Build head."""
  48     return build(cfg, HEADS)
  49 
  50 
  51 def build_recognizer(cfg, train_cfg=None, test_cfg=None):
  52     """Build recognizer."""
  53     return build(cfg, RECOGNIZERS,
  54                  dict(train_cfg=train_cfg, test_cfg=test_cfg))
  55 
  56 
  57 def build_loss(cfg):
  58     """Build loss."""
  59     return build(cfg, LOSSES)
  60 
  61 
  62 def build_localizer(cfg):
  63     """Build localizer."""
  64     return build(cfg, LOCALIZERS)
  65 
  66 
  67 def build_model(cfg, train_cfg=None, test_cfg=None):
  68     """Build model."""
  69     args = cfg.copy()
  70     obj_type = args.pop('type')
  71     if obj_type in LOCALIZERS:
  72         return build_localizer(cfg)
  73     if obj_type in RECOGNIZERS:
  74         return build_recognizer(cfg, train_cfg, test_cfg)
  75     if obj_type in DETECTORS:
  76         return build_detector(cfg, train_cfg, test_cfg)
  77     raise ValueError(f'{obj_type} is not registered in '
  78                      'LOCALIZERS, RECOGNIZERS or DETECTORS')
  79 
  80 
  81 def build_neck(cfg):
  82     """Build neck."""
  83     return build(cfg, NECKS)
  84
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/mmaction/models/builder.py b/mmaction/models/builder.py
  --- a/mmaction/models/builder.py
  +++ b/mmaction/models/builder.py
  @@ -74,6 +74,10 @@
           return build_recognizer(cfg, train_cfg, test_cfg)
       if obj_type in DETECTORS:
           return build_detector(cfg, train_cfg, test_cfg)
  +    model_in_mmdet = ['FastRCNN']
  +    if obj_type in model_in_mmdet:
  +        raise ImportError(
  +            'Please install mmdet for spatial temporal detection tasks.')
       raise ValueError(f'{obj_type} is not registered in '
                        'LOCALIZERS, RECOGNIZERS or DETECTORS')
  
verification_info: {"golden_diff": "diff --git a/mmaction/models/builder.py b/mmaction/models/builder.py\n--- a/mmaction/models/builder.py\n+++ b/mmaction/models/builder.py\n@@ -74,6 +74,10 @@\n         return build_recognizer(cfg, train_cfg, test_cfg)\n     if obj_type in DETECTORS:\n         return build_detector(cfg, train_cfg, test_cfg)\n+    model_in_mmdet = ['FastRCNN']\n+    if obj_type in model_in_mmdet:\n+        raise ImportError(\n+            'Please install mmdet for spatial temporal detection tasks.')\n     raise ValueError(f'{obj_type} is not registered in '\n                      'LOCALIZERS, RECOGNIZERS or DETECTORS')\n", "issue": "ValueError: FastRCNN is not registered in LOCALIZERS, RECOGNIZERS or DETECTORS\nHello\r\nwhen I train AVA dataset find a error\r\nValueError: FastRCNN is not registered in LOCALIZERS, RECOGNIZERS or DETECTORS\r\nhow to solve it \r\nthink you very much \n", "before_files": [{"content": "import torch.nn as nn\nfrom mmcv.utils import Registry, build_from_cfg\n\nfrom mmaction.utils import import_module_error_func\nfrom .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS\n\ntry:\n    from mmdet.models.builder import DETECTORS, build_detector\nexcept (ImportError, ModuleNotFoundError):\n    # Define an empty registry and building func, so that can import\n    DETECTORS = Registry('detector')\n\n    @import_module_error_func('mmdet')\n    def build_detector(cfg, train_cfg, test_cfg):\n        pass\n\n\ndef build(cfg, registry, default_args=None):\n    \"\"\"Build a module.\n\n    Args:\n        cfg (dict, list[dict]): The config of modules, it is either a dict\n            or a list of configs.\n        registry (:obj:`Registry`): A registry the module belongs to.\n        default_args (dict, optional): Default arguments to build the module.\n            Defaults to None.\n\n    Returns:\n        nn.Module: A built nn module.\n    \"\"\"\n\n    if isinstance(cfg, list):\n        modules = [\n            build_from_cfg(cfg_, registry, default_args) for cfg_ in cfg\n        ]\n        return nn.Sequential(*modules)\n\n    return build_from_cfg(cfg, registry, default_args)\n\n\ndef build_backbone(cfg):\n    \"\"\"Build backbone.\"\"\"\n    return build(cfg, BACKBONES)\n\n\ndef build_head(cfg):\n    \"\"\"Build head.\"\"\"\n    return build(cfg, HEADS)\n\n\ndef build_recognizer(cfg, train_cfg=None, test_cfg=None):\n    \"\"\"Build recognizer.\"\"\"\n    return build(cfg, RECOGNIZERS,\n                 dict(train_cfg=train_cfg, test_cfg=test_cfg))\n\n\ndef build_loss(cfg):\n    \"\"\"Build loss.\"\"\"\n    return build(cfg, LOSSES)\n\n\ndef build_localizer(cfg):\n    \"\"\"Build localizer.\"\"\"\n    return build(cfg, LOCALIZERS)\n\n\ndef build_model(cfg, train_cfg=None, test_cfg=None):\n    \"\"\"Build model.\"\"\"\n    args = cfg.copy()\n    obj_type = args.pop('type')\n    if obj_type in LOCALIZERS:\n        return build_localizer(cfg)\n    if obj_type in RECOGNIZERS:\n        return build_recognizer(cfg, train_cfg, test_cfg)\n    if obj_type in DETECTORS:\n        return build_detector(cfg, train_cfg, test_cfg)\n    raise ValueError(f'{obj_type} is not registered in '\n                     'LOCALIZERS, RECOGNIZERS or DETECTORS')\n\n\ndef build_neck(cfg):\n    \"\"\"Build neck.\"\"\"\n    return build(cfg, NECKS)\n", "path": "mmaction/models/builder.py"}], "after_files": [{"content": "import torch.nn as nn\nfrom mmcv.utils import Registry, build_from_cfg\n\nfrom mmaction.utils import import_module_error_func\nfrom .registry import BACKBONES, HEADS, LOCALIZERS, LOSSES, NECKS, RECOGNIZERS\n\ntry:\n    from mmdet.models.builder import DETECTORS, build_detector\nexcept (ImportError, ModuleNotFoundError):\n    # Define an empty registry and building func, so that can import\n    DETECTORS = Registry('detector')\n\n    @import_module_error_func('mmdet')\n    def build_detector(cfg, train_cfg, test_cfg):\n        pass\n\n\ndef build(cfg, registry, default_args=None):\n    \"\"\"Build a module.\n\n    Args:\n        cfg (dict, list[dict]): The config of modules, it is either a dict\n            or a list of configs.\n        registry (:obj:`Registry`): A registry the module belongs to.\n        default_args (dict, optional): Default arguments to build the module.\n            Defaults to None.\n\n    Returns:\n        nn.Module: A built nn module.\n    \"\"\"\n\n    if isinstance(cfg, list):\n        modules = [\n            build_from_cfg(cfg_, registry, default_args) for cfg_ in cfg\n        ]\n        return nn.Sequential(*modules)\n\n    return build_from_cfg(cfg, registry, default_args)\n\n\ndef build_backbone(cfg):\n    \"\"\"Build backbone.\"\"\"\n    return build(cfg, BACKBONES)\n\n\ndef build_head(cfg):\n    \"\"\"Build head.\"\"\"\n    return build(cfg, HEADS)\n\n\ndef build_recognizer(cfg, train_cfg=None, test_cfg=None):\n    \"\"\"Build recognizer.\"\"\"\n    return build(cfg, RECOGNIZERS,\n                 dict(train_cfg=train_cfg, test_cfg=test_cfg))\n\n\ndef build_loss(cfg):\n    \"\"\"Build loss.\"\"\"\n    return build(cfg, LOSSES)\n\n\ndef build_localizer(cfg):\n    \"\"\"Build localizer.\"\"\"\n    return build(cfg, LOCALIZERS)\n\n\ndef build_model(cfg, train_cfg=None, test_cfg=None):\n    \"\"\"Build model.\"\"\"\n    args = cfg.copy()\n    obj_type = args.pop('type')\n    if obj_type in LOCALIZERS:\n        return build_localizer(cfg)\n    if obj_type in RECOGNIZERS:\n        return build_recognizer(cfg, train_cfg, test_cfg)\n    if obj_type in DETECTORS:\n        return build_detector(cfg, train_cfg, test_cfg)\n    model_in_mmdet = ['FastRCNN']\n    if obj_type in model_in_mmdet:\n        raise ImportError(\n            'Please install mmdet for spatial temporal detection tasks.')\n    raise ValueError(f'{obj_type} is not registered in '\n                     'LOCALIZERS, RECOGNIZERS or DETECTORS')\n\n\ndef build_neck(cfg):\n    \"\"\"Build neck.\"\"\"\n    return build(cfg, NECKS)\n", "path": "mmaction/models/builder.py"}]}