We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
VOCDataset object has no attribute dataset
Thanks for your error report and we appreciate it a lot.

**Checklist**
1. I have searched related issues but cannot get the expected help.
2. The bug has not been fixed in the latest version.

**Describe the bug**
I tried to train my model on Pascal VOC 2012 dataset, and set the config for data as follows:
```python3
batch_size = 8

data = dict(
    samples_per_gpu=batch_size,
    workers_per_gpu=4,
    train=dict(
        type=dataset_type,
        ann_file=data_root + 'VOC2012/ImageSets/Main/train.txt',
        img_prefix=data_root + 'VOC2012/',
        pipeline=train_pipeline,),
    val=dict(
        type=dataset_type,
        ann_file=data_root + 'VOC2012/ImageSets/Main/val.txt',
        img_prefix=data_root + 'VOC2012/',
        pipeline=test_pipeline,),
)

evaluation=dict(interval=1, metric='mAP')
```
But during evaluation, it raised following error:
```shell
File "train.py", line 166, in <module>
    main()
  File "train.py", line 162, in main
    meta=meta)
  File "/home/lfc199471/mmdetection/mmdet/apis/train.py", line 128, in train_detector
    runner.run(data_loaders, cfg.workflow, cfg.total_epochs)
  File "/home/lfc199471/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 122, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/home/lfc199471/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 46, in train
    self.call_hook('after_train_epoch')
  File "/home/lfc199471/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 282, in call_hook
    getattr(hook, fn_name)(self)
  File "/home/lfc199471/mmdetection/mmdet/core/evaluation/eval_hooks.py", line 28, in after_train_epoch
    self.evaluate(runner, results)
  File "/home/lfc199471/mmdetection/mmdet/core/evaluation/eval_hooks.py", line 32, in evaluate
    results, logger=runner.logger, **self.eval_kwargs)
  File "/home/lfc199471/mmdetection/mmdet/datasets/voc.py", line 43, in evaluate
    ds_name = self.dataset.CLASSES
AttributeError: 'VOCDataset' object has no attribute 'dataset'
```
I checked the `voc.py` in `mmdet` and found that in line 43, it was
```python3
ds_name = self.dataset.CLASSES
```
but `VOCDataset` and its superclasses `XMLDataset` and `CustomDataset` don't have this attribute.  Is it a bug or did I make some mistakes in the config?

**Reproduction**
1. What command or script did you run?
```
python tools/train.py --gpus 1 configs/<my_config_file>
```
2. Did you make any modifications on the code or config? Did you understand what you have modified?
Yes, please see above.

3. What dataset did you use?
Pascal VOC 2012 detection
**Environment**
1. Please run `python mmdet/utils/collect_env.py` to collect necessary environment infomation and paste it here.
```shell
sys.platform: linux
Python: 3.7.6 (default, Jan  8 2020, 19:59:22) [GCC 7.3.0]
CUDA available: True
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 10.2, V10.2.89
GPU 0: Tesla P100-PCIE-16GB
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.5.1
PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.2
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37
  - CuDNN 7.6.5
  - Magma 2.5.2
  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_INTERNAL_THREADPOOL_IMPL -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF, 

TorchVision: 0.6.0a0+35d732a
OpenCV: 4.2.0
MMCV: 0.6.1
MMDetection: 2.1.0+b44e78b
MMDetection Compiler: GCC 7.5
MMDetection CUDA Compiler: 10.2
```

2. You may add addition that may be helpful for locating the problem, such as
    - How you installed PyTorch [e.g., pip, conda, source] : conda


If you need any log file or some source code from me, just let me know. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mmdet/datasets/voc.py`
Content:
```
1 from mmdet.core import eval_map, eval_recalls
2 from .builder import DATASETS
3 from .xml_style import XMLDataset
4 
5 
6 @DATASETS.register_module()
7 class VOCDataset(XMLDataset):
8 
9     CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car',
10                'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse',
11                'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train',
12                'tvmonitor')
13 
14     def __init__(self, **kwargs):
15         super(VOCDataset, self).__init__(**kwargs)
16         if 'VOC2007' in self.img_prefix:
17             self.year = 2007
18         elif 'VOC2012' in self.img_prefix:
19             self.year = 2012
20         else:
21             raise ValueError('Cannot infer dataset year from img_prefix')
22 
23     def evaluate(self,
24                  results,
25                  metric='mAP',
26                  logger=None,
27                  proposal_nums=(100, 300, 1000),
28                  iou_thr=0.5,
29                  scale_ranges=None):
30         """Evaluate in VOC protocol.
31 
32         Args:
33             results (list[list | tuple]): Testing results of the dataset.
34             metric (str | list[str]): Metrics to be evaluated. Options are
35                 'mAP', 'recall'.
36             logger (logging.Logger | str, optional): Logger used for printing
37                 related information during evaluation. Default: None.
38             proposal_nums (Sequence[int]): Proposal number used for evaluating
39                 recalls, such as recall@100, recall@1000.
40                 Default: (100, 300, 1000).
41             iou_thr (float | list[float]): IoU threshold. It must be a float
42                 when evaluating mAP, and can be a list when evaluating recall.
43                 Default: 0.5.
44             scale_ranges (list[tuple], optional): Scale ranges for evaluating
45                 mAP. If not specified, all bounding boxes would be included in
46                 evaluation. Default: None.
47 
48         Returns:
49             dict[str, float]: AP/recall metrics.
50         """
51 
52         if not isinstance(metric, str):
53             assert len(metric) == 1
54             metric = metric[0]
55         allowed_metrics = ['mAP', 'recall']
56         if metric not in allowed_metrics:
57             raise KeyError(f'metric {metric} is not supported')
58         annotations = [self.get_ann_info(i) for i in range(len(self))]
59         eval_results = {}
60         if metric == 'mAP':
61             assert isinstance(iou_thr, float)
62             if self.year == 2007:
63                 ds_name = 'voc07'
64             else:
65                 ds_name = self.dataset.CLASSES
66             mean_ap, _ = eval_map(
67                 results,
68                 annotations,
69                 scale_ranges=None,
70                 iou_thr=iou_thr,
71                 dataset=ds_name,
72                 logger=logger)
73             eval_results['mAP'] = mean_ap
74         elif metric == 'recall':
75             gt_bboxes = [ann['bboxes'] for ann in annotations]
76             if isinstance(iou_thr, float):
77                 iou_thr = [iou_thr]
78             recalls = eval_recalls(
79                 gt_bboxes, results, proposal_nums, iou_thr, logger=logger)
80             for i, num in enumerate(proposal_nums):
81                 for j, iou in enumerate(iou_thr):
82                     eval_results[f'recall@{num}@{iou}'] = recalls[i, j]
83             if recalls.shape[1] > 1:
84                 ar = recalls.mean(axis=1)
85                 for i, num in enumerate(proposal_nums):
86                     eval_results[f'AR@{num}'] = ar[i]
87         return eval_results
88
```
--- 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()

```

diff --git a/mmdet/datasets/voc.py b/mmdet/datasets/voc.py
--- a/mmdet/datasets/voc.py
+++ b/mmdet/datasets/voc.py
@@ -62,7 +62,7 @@
             if self.year == 2007:
                 ds_name = 'voc07'
             else:
-                ds_name = self.dataset.CLASSES
+                ds_name = self.CLASSES
             mean_ap, _ = eval_map(
                 results,
                 annotations,

{"golden_diff": "diff --git a/mmdet/datasets/voc.py b/mmdet/datasets/voc.py\n--- a/mmdet/datasets/voc.py\n+++ b/mmdet/datasets/voc.py\n@@ -62,7 +62,7 @@\n             if self.year == 2007:\n                 ds_name = 'voc07'\n             else:\n-                ds_name = self.dataset.CLASSES\n+                ds_name = self.CLASSES\n             mean_ap, _ = eval_map(\n                 results,\n                 annotations,\n", "issue": "VOCDataset object has no attribute dataset\nThanks for your error report and we appreciate it a lot.\r\n\r\n**Checklist**\r\n1. I have searched related issues but cannot get the expected help.\r\n2. The bug has not been fixed in the latest version.\r\n\r\n**Describe the bug**\r\nI tried to train my model on Pascal VOC 2012 dataset, and set the config for data as follows:\r\n```python3\r\nbatch_size = 8\r\n\r\ndata = dict(\r\n    samples_per_gpu=batch_size,\r\n    workers_per_gpu=4,\r\n    train=dict(\r\n        type=dataset_type,\r\n        ann_file=data_root + 'VOC2012/ImageSets/Main/train.txt',\r\n        img_prefix=data_root + 'VOC2012/',\r\n        pipeline=train_pipeline,),\r\n    val=dict(\r\n        type=dataset_type,\r\n        ann_file=data_root + 'VOC2012/ImageSets/Main/val.txt',\r\n        img_prefix=data_root + 'VOC2012/',\r\n        pipeline=test_pipeline,),\r\n)\r\n\r\nevaluation=dict(interval=1, metric='mAP')\r\n```\r\nBut during evaluation, it raised following error:\r\n```shell\r\nFile \"train.py\", line 166, in <module>\r\n    main()\r\n  File \"train.py\", line 162, in main\r\n    meta=meta)\r\n  File \"/home/lfc199471/mmdetection/mmdet/apis/train.py\", line 128, in train_detector\r\n    runner.run(data_loaders, cfg.workflow, cfg.total_epochs)\r\n  File \"/home/lfc199471/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py\", line 122, in run\r\n    epoch_runner(data_loaders[i], **kwargs)\r\n  File \"/home/lfc199471/anaconda3/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py\", line 46, in train\r\n    self.call_hook('after_train_epoch')\r\n  File \"/home/lfc199471/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py\", line 282, in call_hook\r\n    getattr(hook, fn_name)(self)\r\n  File \"/home/lfc199471/mmdetection/mmdet/core/evaluation/eval_hooks.py\", line 28, in after_train_epoch\r\n    self.evaluate(runner, results)\r\n  File \"/home/lfc199471/mmdetection/mmdet/core/evaluation/eval_hooks.py\", line 32, in evaluate\r\n    results, logger=runner.logger, **self.eval_kwargs)\r\n  File \"/home/lfc199471/mmdetection/mmdet/datasets/voc.py\", line 43, in evaluate\r\n    ds_name = self.dataset.CLASSES\r\nAttributeError: 'VOCDataset' object has no attribute 'dataset'\r\n```\r\nI checked the `voc.py` in `mmdet` and found that in line 43, it was\r\n```python3\r\nds_name = self.dataset.CLASSES\r\n```\r\nbut `VOCDataset` and its superclasses `XMLDataset` and `CustomDataset` don't have this attribute.  Is it a bug or did I make some mistakes in the config?\r\n\r\n**Reproduction**\r\n1. What command or script did you run?\r\n```\r\npython tools/train.py --gpus 1 configs/<my_config_file>\r\n```\r\n2. Did you make any modifications on the code or config? Did you understand what you have modified?\r\nYes, please see above.\r\n\r\n3. What dataset did you use?\r\nPascal VOC 2012 detection\r\n**Environment**\r\n1. Please run `python mmdet/utils/collect_env.py` to collect necessary environment infomation and paste it here.\r\n```shell\r\nsys.platform: linux\r\nPython: 3.7.6 (default, Jan  8 2020, 19:59:22) [GCC 7.3.0]\r\nCUDA available: True\r\nCUDA_HOME: /usr/local/cuda\r\nNVCC: Cuda compilation tools, release 10.2, V10.2.89\r\nGPU 0: Tesla P100-PCIE-16GB\r\nGCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0\r\nPyTorch: 1.5.1\r\nPyTorch compiling details: PyTorch built with:\r\n  - GCC 7.3\r\n  - C++ Version: 201402\r\n  - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications\r\n  - Intel(R) MKL-DNN v0.21.1 (Git Hash 7d2fd500bc78936d1d648ca713b901012f470dbc)\r\n  - OpenMP 201511 (a.k.a. OpenMP 4.5)\r\n  - NNPACK is enabled\r\n  - CPU capability usage: AVX2\r\n  - CUDA Runtime 10.2\r\n  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37\r\n  - CuDNN 7.6.5\r\n  - Magma 2.5.2\r\n  - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_INTERNAL_THREADPOOL_IMPL -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_STATIC_DISPATCH=OFF, \r\n\r\nTorchVision: 0.6.0a0+35d732a\r\nOpenCV: 4.2.0\r\nMMCV: 0.6.1\r\nMMDetection: 2.1.0+b44e78b\r\nMMDetection Compiler: GCC 7.5\r\nMMDetection CUDA Compiler: 10.2\r\n```\r\n\r\n2. You may add addition that may be helpful for locating the problem, such as\r\n    - How you installed PyTorch [e.g., pip, conda, source] : conda\r\n\r\n\r\nIf you need any log file or some source code from me, just let me know. \n", "before_files": [{"content": "from mmdet.core import eval_map, eval_recalls\nfrom .builder import DATASETS\nfrom .xml_style import XMLDataset\n\n\n@DATASETS.register_module()\nclass VOCDataset(XMLDataset):\n\n    CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car',\n               'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse',\n               'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train',\n               'tvmonitor')\n\n    def __init__(self, **kwargs):\n        super(VOCDataset, self).__init__(**kwargs)\n        if 'VOC2007' in self.img_prefix:\n            self.year = 2007\n        elif 'VOC2012' in self.img_prefix:\n            self.year = 2012\n        else:\n            raise ValueError('Cannot infer dataset year from img_prefix')\n\n    def evaluate(self,\n                 results,\n                 metric='mAP',\n                 logger=None,\n                 proposal_nums=(100, 300, 1000),\n                 iou_thr=0.5,\n                 scale_ranges=None):\n        \"\"\"Evaluate in VOC protocol.\n\n        Args:\n            results (list[list | tuple]): Testing results of the dataset.\n            metric (str | list[str]): Metrics to be evaluated. Options are\n                'mAP', 'recall'.\n            logger (logging.Logger | str, optional): Logger used for printing\n                related information during evaluation. Default: None.\n            proposal_nums (Sequence[int]): Proposal number used for evaluating\n                recalls, such as recall@100, recall@1000.\n                Default: (100, 300, 1000).\n            iou_thr (float | list[float]): IoU threshold. It must be a float\n                when evaluating mAP, and can be a list when evaluating recall.\n                Default: 0.5.\n            scale_ranges (list[tuple], optional): Scale ranges for evaluating\n                mAP. If not specified, all bounding boxes would be included in\n                evaluation. Default: None.\n\n        Returns:\n            dict[str, float]: AP/recall metrics.\n        \"\"\"\n\n        if not isinstance(metric, str):\n            assert len(metric) == 1\n            metric = metric[0]\n        allowed_metrics = ['mAP', 'recall']\n        if metric not in allowed_metrics:\n            raise KeyError(f'metric {metric} is not supported')\n        annotations = [self.get_ann_info(i) for i in range(len(self))]\n        eval_results = {}\n        if metric == 'mAP':\n            assert isinstance(iou_thr, float)\n            if self.year == 2007:\n                ds_name = 'voc07'\n            else:\n                ds_name = self.dataset.CLASSES\n            mean_ap, _ = eval_map(\n                results,\n                annotations,\n                scale_ranges=None,\n                iou_thr=iou_thr,\n                dataset=ds_name,\n                logger=logger)\n            eval_results['mAP'] = mean_ap\n        elif metric == 'recall':\n            gt_bboxes = [ann['bboxes'] for ann in annotations]\n            if isinstance(iou_thr, float):\n                iou_thr = [iou_thr]\n            recalls = eval_recalls(\n                gt_bboxes, results, proposal_nums, iou_thr, logger=logger)\n            for i, num in enumerate(proposal_nums):\n                for j, iou in enumerate(iou_thr):\n                    eval_results[f'recall@{num}@{iou}'] = recalls[i, j]\n            if recalls.shape[1] > 1:\n                ar = recalls.mean(axis=1)\n                for i, num in enumerate(proposal_nums):\n                    eval_results[f'AR@{num}'] = ar[i]\n        return eval_results\n", "path": "mmdet/datasets/voc.py"}], "after_files": [{"content": "from mmdet.core import eval_map, eval_recalls\nfrom .builder import DATASETS\nfrom .xml_style import XMLDataset\n\n\n@DATASETS.register_module()\nclass VOCDataset(XMLDataset):\n\n    CLASSES = ('aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car',\n               'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse',\n               'motorbike', 'person', 'pottedplant', 'sheep', 'sofa', 'train',\n               'tvmonitor')\n\n    def __init__(self, **kwargs):\n        super(VOCDataset, self).__init__(**kwargs)\n        if 'VOC2007' in self.img_prefix:\n            self.year = 2007\n        elif 'VOC2012' in self.img_prefix:\n            self.year = 2012\n        else:\n            raise ValueError('Cannot infer dataset year from img_prefix')\n\n    def evaluate(self,\n                 results,\n                 metric='mAP',\n                 logger=None,\n                 proposal_nums=(100, 300, 1000),\n                 iou_thr=0.5,\n                 scale_ranges=None):\n        \"\"\"Evaluate in VOC protocol.\n\n        Args:\n            results (list[list | tuple]): Testing results of the dataset.\n            metric (str | list[str]): Metrics to be evaluated. Options are\n                'mAP', 'recall'.\n            logger (logging.Logger | str, optional): Logger used for printing\n                related information during evaluation. Default: None.\n            proposal_nums (Sequence[int]): Proposal number used for evaluating\n                recalls, such as recall@100, recall@1000.\n                Default: (100, 300, 1000).\n            iou_thr (float | list[float]): IoU threshold. It must be a float\n                when evaluating mAP, and can be a list when evaluating recall.\n                Default: 0.5.\n            scale_ranges (list[tuple], optional): Scale ranges for evaluating\n                mAP. If not specified, all bounding boxes would be included in\n                evaluation. Default: None.\n\n        Returns:\n            dict[str, float]: AP/recall metrics.\n        \"\"\"\n\n        if not isinstance(metric, str):\n            assert len(metric) == 1\n            metric = metric[0]\n        allowed_metrics = ['mAP', 'recall']\n        if metric not in allowed_metrics:\n            raise KeyError(f'metric {metric} is not supported')\n        annotations = [self.get_ann_info(i) for i in range(len(self))]\n        eval_results = {}\n        if metric == 'mAP':\n            assert isinstance(iou_thr, float)\n            if self.year == 2007:\n                ds_name = 'voc07'\n            else:\n                ds_name = self.CLASSES\n            mean_ap, _ = eval_map(\n                results,\n                annotations,\n                scale_ranges=None,\n                iou_thr=iou_thr,\n                dataset=ds_name,\n                logger=logger)\n            eval_results['mAP'] = mean_ap\n        elif metric == 'recall':\n            gt_bboxes = [ann['bboxes'] for ann in annotations]\n            if isinstance(iou_thr, float):\n                iou_thr = [iou_thr]\n            recalls = eval_recalls(\n                gt_bboxes, results, proposal_nums, iou_thr, logger=logger)\n            for i, num in enumerate(proposal_nums):\n                for j, iou in enumerate(iou_thr):\n                    eval_results[f'recall@{num}@{iou}'] = recalls[i, j]\n            if recalls.shape[1] > 1:\n                ar = recalls.mean(axis=1)\n                for i, num in enumerate(proposal_nums):\n                    eval_results[f'AR@{num}'] = ar[i]\n        return eval_results\n", "path": "mmdet/datasets/voc.py"}]}