We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Missing best config after fit for object detection fit example
After executing object detection example, it only produces:

```
INFO:autogluon.task.object_detection.object_detection:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting
INFO:autogluon.task.object_detection.object_detection:The best config:
```
while no best config is reported.

Might relate to https://github.com/awslabs/autogluon/issues/29

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `autogluon/task/object_detection/object_detection.py`
Content:
```
1 import logging
2 
3 import mxnet as mx
4 from mxnet import gluon, nd
5 
6 from ...core.optimizer import *
7 from ...core.optimizer import *
8 from ...core import *
9 from ...searcher import *
10 from ...scheduler import *
11 from ...scheduler.resource import get_cpu_count, get_gpu_count
12 from ..base import BaseTask
13 
14 from .dataset import *
15 from .pipeline import train_object_detection
16 from .utils import *
17 from ...utils import update_params
18 
19 from .detector import Detector
20 
21 __all__ = ['ObjectDetection']
22 
23 logger = logging.getLogger(__name__)
24 
25 class ObjectDetection(BaseTask):
26     """AutoGluon ImageClassification Task
27     """
28     @staticmethod
29     def Dataset(*args, **kwargs):
30         return get_dataset(*args, **kwargs)
31 
32     @staticmethod
33     def fit(dataset='voc',
34             net=Categorical('mobilenet1.0'),
35             lr=Categorical(5e-4, 1e-4),
36             loss=gluon.loss.SoftmaxCrossEntropyLoss(),
37             batch_size=16,
38             epochs=200,
39             num_trials=2,
40             nthreads_per_trial=12,
41             num_workers=32,
42             ngpus_per_trial=1,
43             hybridize=True,
44             search_strategy='random',
45             search_options={},
46             time_limits=None,
47             resume=False,
48             checkpoint='checkpoint/exp1.ag',
49             visualizer='none',
50             dist_ip_addrs=[],
51             grace_period=None,
52             auto_search=True,
53             seed=223,
54             data_shape=416,
55             start_epoch=0,
56             lr_mode='step',
57             lr_decay=0.1,
58             lr_decay_period=0,
59             lr_decay_epoch='160,180',
60             warmup_lr=0.0,
61             warmup_epochs=2,
62             momentum=0.9,
63             wd=0.0005,
64             log_interval=100,
65             save_prefix='',
66             save_interval=10,
67             val_interval=1,
68             num_samples=-1,
69             no_random_shape=False,
70             no_wd=False,
71             mixup=False,
72             no_mixup_epochs=20,
73             label_smooth=False,
74             syncbn=False,
75             ):
76 
77         """
78         Auto fit on object detection dataset
79 
80         Parameters
81         ----------
82         dataset : str or :meth:`autogluon.task.ObjectDectection.Dataset`
83             Training dataset.
84         net : str, :class:`autogluon.AutoGluonObject`
85             Network candidates.
86         optimizer : str, :class:`autogluon.AutoGluonObject`
87             optimizer candidates.
88          metric : str or object
89             observation metric.
90         loss : mxnet.gluon.loss
91             training loss function.
92         num_trials : int
93             number of trials in the experiment.
94         time_limits : int
95             training time limits in seconds.
96         resources_per_trial : dict
97             Machine resources to allocate per trial.
98         savedir : str
99             Local dir to save training results to.
100         search_strategy : str or callable
101             Search Algorithms ('random', 'bayesopt' and 'hyperband')
102         resume : bool, default False
103             If checkpoint exists, the experiment will resume from there.
104 
105         Examples
106         --------
107         >>> dataset = task.Dataset(train_path='~/data/train',
108         >>>                        test_path='data/test')
109         >>> results = task.fit(dataset,
110         >>>                    nets=ag.space.Categorical['resnet18_v1', 'resnet34_v1'],
111         >>>                    time_limits=time_limits,
112         >>>                    ngpus_per_trial=1,
113         >>>                    num_trials = 4)
114         """
115         if auto_search:
116             # The strategies can be injected here, for example: automatic suggest some hps
117             # based on the dataset statistics
118             pass
119 
120         nthreads_per_trial = get_cpu_count() if nthreads_per_trial > get_cpu_count() else nthreads_per_trial
121         ngpus_per_trial = get_gpu_count() if ngpus_per_trial > get_gpu_count() else ngpus_per_trial
122 
123         train_object_detection.register_args(
124             dataset=dataset,
125             net=net,
126             lr = lr,
127             loss=loss,
128             num_gpus=ngpus_per_trial,
129             batch_size=batch_size,
130             epochs=epochs,
131             num_workers=nthreads_per_trial,
132             hybridize=hybridize,
133             final_fit=False,
134             seed=seed,
135             data_shape=data_shape,
136             start_epoch=0,
137             lr_mode=lr_mode,
138             lr_decay=lr_decay,
139             lr_decay_period=lr_decay_period,
140             lr_decay_epoch=lr_decay_epoch,
141             warmup_lr=warmup_lr,
142             warmup_epochs=warmup_epochs,
143             momentum=momentum,
144             wd=wd,
145             log_interval=log_interval,
146             save_prefix=save_prefix,
147             save_interval=save_interval,
148             val_interval=val_interval,
149             num_samples=num_samples,
150             no_random_shape=no_random_shape,
151             no_wd=no_wd,
152             mixup=mixup,
153             no_mixup_epochs=no_mixup_epochs,
154             label_smooth=label_smooth,
155             resume=resume,
156             syncbn=syncbn)
157 
158         scheduler_options = {
159             'resource': {'num_cpus': nthreads_per_trial, 'num_gpus': ngpus_per_trial},
160             'checkpoint': checkpoint,
161             'num_trials': num_trials,
162             'time_out': time_limits,
163             'resume': resume,
164             'visualizer': visualizer,
165             'time_attr': 'epoch',
166             'reward_attr': 'map_reward',
167             'dist_ip_addrs': dist_ip_addrs,
168             'searcher': search_strategy,
169             'search_options': search_options,
170         }
171         if search_strategy == 'hyperband':
172             scheduler_options.update({
173                 'searcher': 'random',
174                 'max_t': epochs,
175                 'grace_period': grace_period if grace_period else epochs//4})
176                 
177         results = BaseTask.run_fit(train_object_detection, search_strategy,
178                                    scheduler_options)
179         logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting")
180         args = sample_config(train_object_detection.args, results['best_config'])
181         logger.info('The best config:\n', results['best_config'])
182 
183         model = get_network(args.net, dataset.init().get_classes(), mx.cpu(0))
184         update_params(model, results.pop('model_params'))
185         return Detector(model, results, checkpoint, args)
186
```
--- 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/autogluon/task/object_detection/object_detection.py b/autogluon/task/object_detection/object_detection.py
--- a/autogluon/task/object_detection/object_detection.py
+++ b/autogluon/task/object_detection/object_detection.py
@@ -178,7 +178,7 @@
                                    scheduler_options)
         logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting")
         args = sample_config(train_object_detection.args, results['best_config'])
-        logger.info('The best config:\n', results['best_config'])
+        logger.info('The best config: {}'.format(results['best_config']))
 
         model = get_network(args.net, dataset.init().get_classes(), mx.cpu(0))
         update_params(model, results.pop('model_params'))

{"golden_diff": "diff --git a/autogluon/task/object_detection/object_detection.py b/autogluon/task/object_detection/object_detection.py\n--- a/autogluon/task/object_detection/object_detection.py\n+++ b/autogluon/task/object_detection/object_detection.py\n@@ -178,7 +178,7 @@\n                                    scheduler_options)\n         logger.info(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting\")\n         args = sample_config(train_object_detection.args, results['best_config'])\n-        logger.info('The best config:\\n', results['best_config'])\n+        logger.info('The best config: {}'.format(results['best_config']))\n \n         model = get_network(args.net, dataset.init().get_classes(), mx.cpu(0))\n         update_params(model, results.pop('model_params'))\n", "issue": "Missing best config after fit for object detection fit example\nAfter executing object detection example, it only produces:\r\n\r\n```\r\nINFO:autogluon.task.object_detection.object_detection:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting\r\nINFO:autogluon.task.object_detection.object_detection:The best config:\r\n```\r\nwhile no best config is reported.\r\n\r\nMight relate to https://github.com/awslabs/autogluon/issues/29\n", "before_files": [{"content": "import logging\n\nimport mxnet as mx\nfrom mxnet import gluon, nd\n\nfrom ...core.optimizer import *\nfrom ...core.optimizer import *\nfrom ...core import *\nfrom ...searcher import *\nfrom ...scheduler import *\nfrom ...scheduler.resource import get_cpu_count, get_gpu_count\nfrom ..base import BaseTask\n\nfrom .dataset import *\nfrom .pipeline import train_object_detection\nfrom .utils import *\nfrom ...utils import update_params\n\nfrom .detector import Detector\n\n__all__ = ['ObjectDetection']\n\nlogger = logging.getLogger(__name__)\n\nclass ObjectDetection(BaseTask):\n    \"\"\"AutoGluon ImageClassification Task\n    \"\"\"\n    @staticmethod\n    def Dataset(*args, **kwargs):\n        return get_dataset(*args, **kwargs)\n\n    @staticmethod\n    def fit(dataset='voc',\n            net=Categorical('mobilenet1.0'),\n            lr=Categorical(5e-4, 1e-4),\n            loss=gluon.loss.SoftmaxCrossEntropyLoss(),\n            batch_size=16,\n            epochs=200,\n            num_trials=2,\n            nthreads_per_trial=12,\n            num_workers=32,\n            ngpus_per_trial=1,\n            hybridize=True,\n            search_strategy='random',\n            search_options={},\n            time_limits=None,\n            resume=False,\n            checkpoint='checkpoint/exp1.ag',\n            visualizer='none',\n            dist_ip_addrs=[],\n            grace_period=None,\n            auto_search=True,\n            seed=223,\n            data_shape=416,\n            start_epoch=0,\n            lr_mode='step',\n            lr_decay=0.1,\n            lr_decay_period=0,\n            lr_decay_epoch='160,180',\n            warmup_lr=0.0,\n            warmup_epochs=2,\n            momentum=0.9,\n            wd=0.0005,\n            log_interval=100,\n            save_prefix='',\n            save_interval=10,\n            val_interval=1,\n            num_samples=-1,\n            no_random_shape=False,\n            no_wd=False,\n            mixup=False,\n            no_mixup_epochs=20,\n            label_smooth=False,\n            syncbn=False,\n            ):\n\n        \"\"\"\n        Auto fit on object detection dataset\n\n        Parameters\n        ----------\n        dataset : str or :meth:`autogluon.task.ObjectDectection.Dataset`\n            Training dataset.\n        net : str, :class:`autogluon.AutoGluonObject`\n            Network candidates.\n        optimizer : str, :class:`autogluon.AutoGluonObject`\n            optimizer candidates.\n         metric : str or object\n            observation metric.\n        loss : mxnet.gluon.loss\n            training loss function.\n        num_trials : int\n            number of trials in the experiment.\n        time_limits : int\n            training time limits in seconds.\n        resources_per_trial : dict\n            Machine resources to allocate per trial.\n        savedir : str\n            Local dir to save training results to.\n        search_strategy : str or callable\n            Search Algorithms ('random', 'bayesopt' and 'hyperband')\n        resume : bool, default False\n            If checkpoint exists, the experiment will resume from there.\n\n        Examples\n        --------\n        >>> dataset = task.Dataset(train_path='~/data/train',\n        >>>                        test_path='data/test')\n        >>> results = task.fit(dataset,\n        >>>                    nets=ag.space.Categorical['resnet18_v1', 'resnet34_v1'],\n        >>>                    time_limits=time_limits,\n        >>>                    ngpus_per_trial=1,\n        >>>                    num_trials = 4)\n        \"\"\"\n        if auto_search:\n            # The strategies can be injected here, for example: automatic suggest some hps\n            # based on the dataset statistics\n            pass\n\n        nthreads_per_trial = get_cpu_count() if nthreads_per_trial > get_cpu_count() else nthreads_per_trial\n        ngpus_per_trial = get_gpu_count() if ngpus_per_trial > get_gpu_count() else ngpus_per_trial\n\n        train_object_detection.register_args(\n            dataset=dataset,\n            net=net,\n            lr = lr,\n            loss=loss,\n            num_gpus=ngpus_per_trial,\n            batch_size=batch_size,\n            epochs=epochs,\n            num_workers=nthreads_per_trial,\n            hybridize=hybridize,\n            final_fit=False,\n            seed=seed,\n            data_shape=data_shape,\n            start_epoch=0,\n            lr_mode=lr_mode,\n            lr_decay=lr_decay,\n            lr_decay_period=lr_decay_period,\n            lr_decay_epoch=lr_decay_epoch,\n            warmup_lr=warmup_lr,\n            warmup_epochs=warmup_epochs,\n            momentum=momentum,\n            wd=wd,\n            log_interval=log_interval,\n            save_prefix=save_prefix,\n            save_interval=save_interval,\n            val_interval=val_interval,\n            num_samples=num_samples,\n            no_random_shape=no_random_shape,\n            no_wd=no_wd,\n            mixup=mixup,\n            no_mixup_epochs=no_mixup_epochs,\n            label_smooth=label_smooth,\n            resume=resume,\n            syncbn=syncbn)\n\n        scheduler_options = {\n            'resource': {'num_cpus': nthreads_per_trial, 'num_gpus': ngpus_per_trial},\n            'checkpoint': checkpoint,\n            'num_trials': num_trials,\n            'time_out': time_limits,\n            'resume': resume,\n            'visualizer': visualizer,\n            'time_attr': 'epoch',\n            'reward_attr': 'map_reward',\n            'dist_ip_addrs': dist_ip_addrs,\n            'searcher': search_strategy,\n            'search_options': search_options,\n        }\n        if search_strategy == 'hyperband':\n            scheduler_options.update({\n                'searcher': 'random',\n                'max_t': epochs,\n                'grace_period': grace_period if grace_period else epochs//4})\n                \n        results = BaseTask.run_fit(train_object_detection, search_strategy,\n                                   scheduler_options)\n        logger.info(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting\")\n        args = sample_config(train_object_detection.args, results['best_config'])\n        logger.info('The best config:\\n', results['best_config'])\n\n        model = get_network(args.net, dataset.init().get_classes(), mx.cpu(0))\n        update_params(model, results.pop('model_params'))\n        return Detector(model, results, checkpoint, args)\n", "path": "autogluon/task/object_detection/object_detection.py"}], "after_files": [{"content": "import logging\n\nimport mxnet as mx\nfrom mxnet import gluon, nd\n\nfrom ...core.optimizer import *\nfrom ...core.optimizer import *\nfrom ...core import *\nfrom ...searcher import *\nfrom ...scheduler import *\nfrom ...scheduler.resource import get_cpu_count, get_gpu_count\nfrom ..base import BaseTask\n\nfrom .dataset import *\nfrom .pipeline import train_object_detection\nfrom .utils import *\nfrom ...utils import update_params\n\nfrom .detector import Detector\n\n__all__ = ['ObjectDetection']\n\nlogger = logging.getLogger(__name__)\n\nclass ObjectDetection(BaseTask):\n    \"\"\"AutoGluon ImageClassification Task\n    \"\"\"\n    @staticmethod\n    def Dataset(*args, **kwargs):\n        return get_dataset(*args, **kwargs)\n\n    @staticmethod\n    def fit(dataset='voc',\n            net=Categorical('mobilenet1.0'),\n            lr=Categorical(5e-4, 1e-4),\n            loss=gluon.loss.SoftmaxCrossEntropyLoss(),\n            batch_size=16,\n            epochs=200,\n            num_trials=2,\n            nthreads_per_trial=12,\n            num_workers=32,\n            ngpus_per_trial=1,\n            hybridize=True,\n            search_strategy='random',\n            search_options={},\n            time_limits=None,\n            resume=False,\n            checkpoint='checkpoint/exp1.ag',\n            visualizer='none',\n            dist_ip_addrs=[],\n            grace_period=None,\n            auto_search=True,\n            seed=223,\n            data_shape=416,\n            start_epoch=0,\n            lr_mode='step',\n            lr_decay=0.1,\n            lr_decay_period=0,\n            lr_decay_epoch='160,180',\n            warmup_lr=0.0,\n            warmup_epochs=2,\n            momentum=0.9,\n            wd=0.0005,\n            log_interval=100,\n            save_prefix='',\n            save_interval=10,\n            val_interval=1,\n            num_samples=-1,\n            no_random_shape=False,\n            no_wd=False,\n            mixup=False,\n            no_mixup_epochs=20,\n            label_smooth=False,\n            syncbn=False,\n            ):\n\n        \"\"\"\n        Auto fit on object detection dataset\n\n        Parameters\n        ----------\n        dataset : str or :meth:`autogluon.task.ObjectDectection.Dataset`\n            Training dataset.\n        net : str, :class:`autogluon.AutoGluonObject`\n            Network candidates.\n        optimizer : str, :class:`autogluon.AutoGluonObject`\n            optimizer candidates.\n         metric : str or object\n            observation metric.\n        loss : mxnet.gluon.loss\n            training loss function.\n        num_trials : int\n            number of trials in the experiment.\n        time_limits : int\n            training time limits in seconds.\n        resources_per_trial : dict\n            Machine resources to allocate per trial.\n        savedir : str\n            Local dir to save training results to.\n        search_strategy : str or callable\n            Search Algorithms ('random', 'bayesopt' and 'hyperband')\n        resume : bool, default False\n            If checkpoint exists, the experiment will resume from there.\n\n        Examples\n        --------\n        >>> dataset = task.Dataset(train_path='~/data/train',\n        >>>                        test_path='data/test')\n        >>> results = task.fit(dataset,\n        >>>                    nets=ag.space.Categorical['resnet18_v1', 'resnet34_v1'],\n        >>>                    time_limits=time_limits,\n        >>>                    ngpus_per_trial=1,\n        >>>                    num_trials = 4)\n        \"\"\"\n        if auto_search:\n            # The strategies can be injected here, for example: automatic suggest some hps\n            # based on the dataset statistics\n            pass\n\n        nthreads_per_trial = get_cpu_count() if nthreads_per_trial > get_cpu_count() else nthreads_per_trial\n        ngpus_per_trial = get_gpu_count() if ngpus_per_trial > get_gpu_count() else ngpus_per_trial\n\n        train_object_detection.register_args(\n            dataset=dataset,\n            net=net,\n            lr = lr,\n            loss=loss,\n            num_gpus=ngpus_per_trial,\n            batch_size=batch_size,\n            epochs=epochs,\n            num_workers=nthreads_per_trial,\n            hybridize=hybridize,\n            final_fit=False,\n            seed=seed,\n            data_shape=data_shape,\n            start_epoch=0,\n            lr_mode=lr_mode,\n            lr_decay=lr_decay,\n            lr_decay_period=lr_decay_period,\n            lr_decay_epoch=lr_decay_epoch,\n            warmup_lr=warmup_lr,\n            warmup_epochs=warmup_epochs,\n            momentum=momentum,\n            wd=wd,\n            log_interval=log_interval,\n            save_prefix=save_prefix,\n            save_interval=save_interval,\n            val_interval=val_interval,\n            num_samples=num_samples,\n            no_random_shape=no_random_shape,\n            no_wd=no_wd,\n            mixup=mixup,\n            no_mixup_epochs=no_mixup_epochs,\n            label_smooth=label_smooth,\n            resume=resume,\n            syncbn=syncbn)\n\n        scheduler_options = {\n            'resource': {'num_cpus': nthreads_per_trial, 'num_gpus': ngpus_per_trial},\n            'checkpoint': checkpoint,\n            'num_trials': num_trials,\n            'time_out': time_limits,\n            'resume': resume,\n            'visualizer': visualizer,\n            'time_attr': 'epoch',\n            'reward_attr': 'map_reward',\n            'dist_ip_addrs': dist_ip_addrs,\n            'searcher': search_strategy,\n            'search_options': search_options,\n        }\n        if search_strategy == 'hyperband':\n            scheduler_options.update({\n                'searcher': 'random',\n                'max_t': epochs,\n                'grace_period': grace_period if grace_period else epochs//4})\n                \n        results = BaseTask.run_fit(train_object_detection, search_strategy,\n                                   scheduler_options)\n        logger.info(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting\")\n        args = sample_config(train_object_detection.args, results['best_config'])\n        logger.info('The best config: {}'.format(results['best_config']))\n\n        model = get_network(args.net, dataset.init().get_classes(), mx.cpu(0))\n        update_params(model, results.pop('model_params'))\n        return Detector(model, results, checkpoint, args)\n", "path": "autogluon/task/object_detection/object_detection.py"}]}