We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
'PathManagerBase' object has no attribute 'makedirs'
In attempting to create the tensorboard directory with PathManager we're calling a nonexistent function.

To repro:
```bash
$ python -m parlai.scripts.train_model -t personachat -m transformer/ranker -mf /tmp/model_tr6 --n-layers 1 --embedding-size 300 --ffn-size 600 --n-heads 4 --num-epochs 2 -veps 0.25 -bs 64 -lr 0.001 --dropout 0.1 --embedding-type fasttext_cc --candidates batch --tensorboard-log true
```

Exception hit:
```
File "/Users/spoff/ParlAI/parlai/core/logs.py", line 56, in __init__
    PathManager.makedirs(tbpath)
AttributeError: 'PathManagerBase' object has no attribute 'makedirs'
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python3
2 
3 # Copyright (c) Facebook, Inc. and its affiliates.
4 # This source code is licensed under the MIT license found in the
5 # LICENSE file in the root directory of this source tree.
6 
7 
8 import sys
9 
10 from setuptools import setup, find_packages
11 
12 VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!
13 
14 if sys.version_info < (3, 6):
15     sys.exit('Sorry, Python >=3.6 is required for ParlAI.')
16 
17 with open('README.md', encoding="utf8") as f:
18     # strip the header and badges etc
19     readme = f.read().split('--------------------')[-1]
20 
21 with open('requirements.txt') as f:
22     reqs = []
23     for line in f:
24         line = line.strip()
25         reqs.append(line.split('==')[0])
26 
27 
28 if __name__ == '__main__':
29     setup(
30         name='parlai',
31         version=VERSION,
32         description='Unified platform for dialogue research.',
33         long_description=readme,
34         long_description_content_type='text/markdown',
35         url='http://parl.ai/',
36         python_requires='>=3.6',
37         packages=find_packages(
38             exclude=('data', 'docs', 'examples', 'tests', 'parlai_internal*')
39         ),
40         install_requires=reqs,
41         include_package_data=True,
42         package_data={'': ['*.txt', '*.md']},
43         entry_points={
44             "flake8.extension": ["PAI = parlai.utils.flake8:ParlAIChecker"],
45             "console_scripts": ["parlai=parlai.__main__:main"],
46         },
47         classifiers=[
48             "Programming Language :: Python :: 3",
49             "License :: OSI Approved :: MIT License",
50             "Topic :: Scientific/Engineering :: Artificial Intelligence",
51             "Natural Language :: English",
52         ],
53     )
54
```

Path: `parlai/core/logs.py`
Content:
```
1 #!/usr/bin/env python3
2 
3 # Copyright (c) Facebook, Inc. and its affiliates.
4 # This source code is licensed under the MIT license found in the
5 # LICENSE file in the root directory of this source tree.
6 """
7 Log metrics to tensorboard.
8 
9 This file provides interface to log any metrics in tensorboard, could be
10 extended to any other tool like visdom.
11 
12 .. code-block: none
13 
14    tensorboard --logdir <PARLAI_DATA/tensorboard> --port 8888.
15 """
16 
17 import json
18 import numbers
19 from parlai.core.opt import Opt
20 from parlai.core.metrics import Metric
21 from parlai.utils.io import PathManager
22 import parlai.utils.logging as logging
23 
24 
25 class TensorboardLogger(object):
26     """
27     Log objects to tensorboard.
28     """
29 
30     @staticmethod
31     def add_cmdline_args(argparser):
32         """
33         Add tensorboard CLI args.
34         """
35         logger = argparser.add_argument_group('Tensorboard Arguments')
36         logger.add_argument(
37             '-tblog',
38             '--tensorboard-log',
39             type='bool',
40             default=False,
41             help="Tensorboard logging of metrics, default is %(default)s",
42             hidden=False,
43         )
44 
45     def __init__(self, opt: Opt):
46         try:
47             # tensorboard is a very expensive thing to import. Wait until the
48             # last second to import it.
49             from tensorboardX import SummaryWriter
50         except ImportError:
51             raise ImportError('Please run `pip install tensorboard tensorboardX`.')
52 
53         tbpath = opt['model_file'] + '.tensorboard'
54         logging.debug(f'Saving tensorboard logs to: {tbpath}')
55         if not PathManager.exists(tbpath):
56             PathManager.makedirs(tbpath)
57         self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))
58 
59     def log_metrics(self, setting, step, report):
60         """
61         Add all metrics from tensorboard_metrics opt key.
62 
63         :param setting:
64             One of train/valid/test. Will be used as the title for the graph.
65         :param step:
66             Number of parleys
67         :param report:
68             The report to log
69         """
70         for k, v in report.items():
71             if isinstance(v, numbers.Number):
72                 self.writer.add_scalar(f'{k}/{setting}', v, global_step=step)
73             elif isinstance(v, Metric):
74                 self.writer.add_scalar(f'{k}/{setting}', v.value(), global_step=step)
75             else:
76                 logging.error(f'k {k} v {v} is not a number')
77 
78     def flush(self):
79         self.writer.flush()
80
```

Path: `parlai/__init__.py`
Content:
```
1 #!/usr/bin/env python3
2 
3 # Copyright (c) Facebook, Inc. and its affiliates.
4 # This source code is licensed under the MIT license found in the
5 # LICENSE file in the root directory of this source tree.
6 
7 __version__ = '0.9.1'
8
```
--- 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/parlai/__init__.py b/parlai/__init__.py
--- a/parlai/__init__.py
+++ b/parlai/__init__.py
@@ -4,4 +4,4 @@
 # This source code is licensed under the MIT license found in the
 # LICENSE file in the root directory of this source tree.
 
-__version__ = '0.9.1'
+__version__ = '0.9.2'
diff --git a/parlai/core/logs.py b/parlai/core/logs.py
--- a/parlai/core/logs.py
+++ b/parlai/core/logs.py
@@ -53,7 +53,7 @@
         tbpath = opt['model_file'] + '.tensorboard'
         logging.debug(f'Saving tensorboard logs to: {tbpath}')
         if not PathManager.exists(tbpath):
-            PathManager.makedirs(tbpath)
+            PathManager.mkdirs(tbpath)
         self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))
 
     def log_metrics(self, setting, step, report):
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@
 
 from setuptools import setup, find_packages
 
-VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!
+VERSION = '0.9.2'  # if you update, update parlai/__init__.py too!
 
 if sys.version_info < (3, 6):
     sys.exit('Sorry, Python >=3.6 is required for ParlAI.')

{"golden_diff": "diff --git a/parlai/__init__.py b/parlai/__init__.py\n--- a/parlai/__init__.py\n+++ b/parlai/__init__.py\n@@ -4,4 +4,4 @@\n # This source code is licensed under the MIT license found in the\n # LICENSE file in the root directory of this source tree.\n \n-__version__ = '0.9.1'\n+__version__ = '0.9.2'\ndiff --git a/parlai/core/logs.py b/parlai/core/logs.py\n--- a/parlai/core/logs.py\n+++ b/parlai/core/logs.py\n@@ -53,7 +53,7 @@\n         tbpath = opt['model_file'] + '.tensorboard'\n         logging.debug(f'Saving tensorboard logs to: {tbpath}')\n         if not PathManager.exists(tbpath):\n-            PathManager.makedirs(tbpath)\n+            PathManager.mkdirs(tbpath)\n         self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))\n \n     def log_metrics(self, setting, step, report):\ndiff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -9,7 +9,7 @@\n \n from setuptools import setup, find_packages\n \n-VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!\n+VERSION = '0.9.2'  # if you update, update parlai/__init__.py too!\n \n if sys.version_info < (3, 6):\n     sys.exit('Sorry, Python >=3.6 is required for ParlAI.')\n", "issue": "'PathManagerBase' object has no attribute 'makedirs'\nIn attempting to create the tensorboard directory with PathManager we're calling a nonexistent function.\r\n\r\nTo repro:\r\n```bash\r\n$ python -m parlai.scripts.train_model -t personachat -m transformer/ranker -mf /tmp/model_tr6 --n-layers 1 --embedding-size 300 --ffn-size 600 --n-heads 4 --num-epochs 2 -veps 0.25 -bs 64 -lr 0.001 --dropout 0.1 --embedding-type fasttext_cc --candidates batch --tensorboard-log true\r\n```\r\n\r\nException hit:\r\n```\r\nFile \"/Users/spoff/ParlAI/parlai/core/logs.py\", line 56, in __init__\r\n    PathManager.makedirs(tbpath)\r\nAttributeError: 'PathManagerBase' object has no attribute 'makedirs'\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport sys\n\nfrom setuptools import setup, find_packages\n\nVERSION = '0.9.1'  # if you update, update parlai/__init__.py too!\n\nif sys.version_info < (3, 6):\n    sys.exit('Sorry, Python >=3.6 is required for ParlAI.')\n\nwith open('README.md', encoding=\"utf8\") as f:\n    # strip the header and badges etc\n    readme = f.read().split('--------------------')[-1]\n\nwith open('requirements.txt') as f:\n    reqs = []\n    for line in f:\n        line = line.strip()\n        reqs.append(line.split('==')[0])\n\n\nif __name__ == '__main__':\n    setup(\n        name='parlai',\n        version=VERSION,\n        description='Unified platform for dialogue research.',\n        long_description=readme,\n        long_description_content_type='text/markdown',\n        url='http://parl.ai/',\n        python_requires='>=3.6',\n        packages=find_packages(\n            exclude=('data', 'docs', 'examples', 'tests', 'parlai_internal*')\n        ),\n        install_requires=reqs,\n        include_package_data=True,\n        package_data={'': ['*.txt', '*.md']},\n        entry_points={\n            \"flake8.extension\": [\"PAI = parlai.utils.flake8:ParlAIChecker\"],\n            \"console_scripts\": [\"parlai=parlai.__main__:main\"],\n        },\n        classifiers=[\n            \"Programming Language :: Python :: 3\",\n            \"License :: OSI Approved :: MIT License\",\n            \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n            \"Natural Language :: English\",\n        ],\n    )\n", "path": "setup.py"}, {"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nLog metrics to tensorboard.\n\nThis file provides interface to log any metrics in tensorboard, could be\nextended to any other tool like visdom.\n\n.. code-block: none\n\n   tensorboard --logdir <PARLAI_DATA/tensorboard> --port 8888.\n\"\"\"\n\nimport json\nimport numbers\nfrom parlai.core.opt import Opt\nfrom parlai.core.metrics import Metric\nfrom parlai.utils.io import PathManager\nimport parlai.utils.logging as logging\n\n\nclass TensorboardLogger(object):\n    \"\"\"\n    Log objects to tensorboard.\n    \"\"\"\n\n    @staticmethod\n    def add_cmdline_args(argparser):\n        \"\"\"\n        Add tensorboard CLI args.\n        \"\"\"\n        logger = argparser.add_argument_group('Tensorboard Arguments')\n        logger.add_argument(\n            '-tblog',\n            '--tensorboard-log',\n            type='bool',\n            default=False,\n            help=\"Tensorboard logging of metrics, default is %(default)s\",\n            hidden=False,\n        )\n\n    def __init__(self, opt: Opt):\n        try:\n            # tensorboard is a very expensive thing to import. Wait until the\n            # last second to import it.\n            from tensorboardX import SummaryWriter\n        except ImportError:\n            raise ImportError('Please run `pip install tensorboard tensorboardX`.')\n\n        tbpath = opt['model_file'] + '.tensorboard'\n        logging.debug(f'Saving tensorboard logs to: {tbpath}')\n        if not PathManager.exists(tbpath):\n            PathManager.makedirs(tbpath)\n        self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))\n\n    def log_metrics(self, setting, step, report):\n        \"\"\"\n        Add all metrics from tensorboard_metrics opt key.\n\n        :param setting:\n            One of train/valid/test. Will be used as the title for the graph.\n        :param step:\n            Number of parleys\n        :param report:\n            The report to log\n        \"\"\"\n        for k, v in report.items():\n            if isinstance(v, numbers.Number):\n                self.writer.add_scalar(f'{k}/{setting}', v, global_step=step)\n            elif isinstance(v, Metric):\n                self.writer.add_scalar(f'{k}/{setting}', v.value(), global_step=step)\n            else:\n                logging.error(f'k {k} v {v} is not a number')\n\n    def flush(self):\n        self.writer.flush()\n", "path": "parlai/core/logs.py"}, {"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n__version__ = '0.9.1'\n", "path": "parlai/__init__.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\nimport sys\n\nfrom setuptools import setup, find_packages\n\nVERSION = '0.9.2'  # if you update, update parlai/__init__.py too!\n\nif sys.version_info < (3, 6):\n    sys.exit('Sorry, Python >=3.6 is required for ParlAI.')\n\nwith open('README.md', encoding=\"utf8\") as f:\n    # strip the header and badges etc\n    readme = f.read().split('--------------------')[-1]\n\nwith open('requirements.txt') as f:\n    reqs = []\n    for line in f:\n        line = line.strip()\n        reqs.append(line.split('==')[0])\n\n\nif __name__ == '__main__':\n    setup(\n        name='parlai',\n        version=VERSION,\n        description='Unified platform for dialogue research.',\n        long_description=readme,\n        long_description_content_type='text/markdown',\n        url='http://parl.ai/',\n        python_requires='>=3.6',\n        packages=find_packages(\n            exclude=('data', 'docs', 'examples', 'tests', 'parlai_internal*')\n        ),\n        install_requires=reqs,\n        include_package_data=True,\n        package_data={'': ['*.txt', '*.md']},\n        entry_points={\n            \"flake8.extension\": [\"PAI = parlai.utils.flake8:ParlAIChecker\"],\n            \"console_scripts\": [\"parlai=parlai.__main__:main\"],\n        },\n        classifiers=[\n            \"Programming Language :: Python :: 3\",\n            \"License :: OSI Approved :: MIT License\",\n            \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n            \"Natural Language :: English\",\n        ],\n    )\n", "path": "setup.py"}, {"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"\nLog metrics to tensorboard.\n\nThis file provides interface to log any metrics in tensorboard, could be\nextended to any other tool like visdom.\n\n.. code-block: none\n\n   tensorboard --logdir <PARLAI_DATA/tensorboard> --port 8888.\n\"\"\"\n\nimport json\nimport numbers\nfrom parlai.core.opt import Opt\nfrom parlai.core.metrics import Metric\nfrom parlai.utils.io import PathManager\nimport parlai.utils.logging as logging\n\n\nclass TensorboardLogger(object):\n    \"\"\"\n    Log objects to tensorboard.\n    \"\"\"\n\n    @staticmethod\n    def add_cmdline_args(argparser):\n        \"\"\"\n        Add tensorboard CLI args.\n        \"\"\"\n        logger = argparser.add_argument_group('Tensorboard Arguments')\n        logger.add_argument(\n            '-tblog',\n            '--tensorboard-log',\n            type='bool',\n            default=False,\n            help=\"Tensorboard logging of metrics, default is %(default)s\",\n            hidden=False,\n        )\n\n    def __init__(self, opt: Opt):\n        try:\n            # tensorboard is a very expensive thing to import. Wait until the\n            # last second to import it.\n            from tensorboardX import SummaryWriter\n        except ImportError:\n            raise ImportError('Please run `pip install tensorboard tensorboardX`.')\n\n        tbpath = opt['model_file'] + '.tensorboard'\n        logging.debug(f'Saving tensorboard logs to: {tbpath}')\n        if not PathManager.exists(tbpath):\n            PathManager.mkdirs(tbpath)\n        self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))\n\n    def log_metrics(self, setting, step, report):\n        \"\"\"\n        Add all metrics from tensorboard_metrics opt key.\n\n        :param setting:\n            One of train/valid/test. Will be used as the title for the graph.\n        :param step:\n            Number of parleys\n        :param report:\n            The report to log\n        \"\"\"\n        for k, v in report.items():\n            if isinstance(v, numbers.Number):\n                self.writer.add_scalar(f'{k}/{setting}', v, global_step=step)\n            elif isinstance(v, Metric):\n                self.writer.add_scalar(f'{k}/{setting}', v.value(), global_step=step)\n            else:\n                logging.error(f'k {k} v {v} is not a number')\n\n    def flush(self):\n        self.writer.flush()\n", "path": "parlai/core/logs.py"}, {"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n__version__ = '0.9.2'\n", "path": "parlai/__init__.py"}]}