prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Checkpoint adding "version_" at the start of the logger name
  **To reproduce :** 
  ```python
  logger = pl.loggers.TensorBoardLogger(
                  save_dir='.',
                  version='my_name'
                  name='lightning_logs'
              )
  
  trainer = pl.Trainer(logger=logger, log_gpu_memory='all', max_epochs=10)
  ```
  
  **Giving as a result:**
  
  -  /lightning_logs/my_name: Where is saved the logs
  -  /lightning_logs/version_my_name : Where is saved the checkpoints
  
  
  
  
  **Possible Explanation:** 
  It seems like the checkpoint saving add "version_" to the start of the name even if the name have been given as a parameter : 
  
  https://github.com/PyTorchLightning/pytorch-lightning/blob/3e8f2d99a9951bfb5fc67a98614128317913be1d/pytorch_lightning/trainer/callback_config.py#L52-L57
  
  Even if in the Tensorboard Logger if the name is provided there is no "version_" prefix :
  
  https://github.com/PyTorchLightning/pytorch-lightning/blob/8b82ce09039e75f3fcb77a987c964249e38def3b/pytorch_lightning/loggers/tensorboard.py#L81
  
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pytorch_lightning/trainer/callback_config.py`
  Content:
  ```
  1 import os
  2 from abc import ABC, abstractmethod
  3 from typing import Union, List
  4 
  5 
  6 from pytorch_lightning.callbacks import Callback, ModelCheckpoint, EarlyStopping, ProgressBarBase, ProgressBar
  7 from pytorch_lightning.loggers import LightningLoggerBase
  8 from pytorch_lightning.utilities.exceptions import MisconfigurationException
  9 
  10 
  11 class TrainerCallbackConfigMixin(ABC):
  12 
  13     # this is just a summary on variables used in this abstract class,
  14     #  the proper values/initialisation should be done in child class
  15     callbacks: List[Callback]
  16     default_root_dir: str
  17     logger: Union[LightningLoggerBase, bool]
  18     weights_save_path: str
  19     ckpt_path: str
  20     checkpoint_callback: ModelCheckpoint
  21     progress_bar_refresh_rate: int
  22     process_position: int
  23 
  24     @property
  25     @abstractmethod
  26     def slurm_job_id(self) -> int:
  27         """Warning: this is just empty shell for code implemented in other class."""
  28 
  29     @abstractmethod
  30     def save_checkpoint(self, *args):
  31         """Warning: this is just empty shell for code implemented in other class."""
  32 
  33     def configure_checkpoint_callback(self):
  34         """
  35         Weight path set in this priority:
  36         Checkpoint_callback's path (if passed in).
  37         User provided weights_saved_path
  38         Otherwise use os.getcwd()
  39         """
  40         ckpt_path = self.default_root_dir
  41         if self.checkpoint_callback:
  42             # init a default one
  43             if self.logger is not None:
  44                 save_dir = (getattr(self.logger, 'save_dir', None) or
  45                             getattr(self.logger, '_save_dir', None) or
  46                             self.default_root_dir)
  47 
  48                 # weights_save_path overrides anything
  49                 if self.weights_save_path is not None:
  50                     save_dir = self.weights_save_path
  51 
  52                 ckpt_path = os.path.join(
  53                     save_dir,
  54                     self.logger.name,
  55                     f'version_{self.logger.version}',
  56                     "checkpoints"
  57                 )
  58             else:
  59                 ckpt_path = os.path.join(self.default_root_dir, "checkpoints")
  60 
  61             # when no val step is defined, use 'loss' otherwise 'val_loss'
  62             train_step_only = not self.is_overriden('validation_step')
  63             monitor_key = 'loss' if train_step_only else 'val_loss'
  64 
  65             if self.checkpoint_callback is True:
  66                 os.makedirs(ckpt_path, exist_ok=True)
  67                 self.checkpoint_callback = ModelCheckpoint(
  68                     filepath=ckpt_path,
  69                     monitor=monitor_key
  70                 )
  71             # If user specified None in filepath, override with runtime default
  72             elif isinstance(self.checkpoint_callback, ModelCheckpoint) \
  73                     and self.checkpoint_callback.dirpath is None:
  74                 self.checkpoint_callback.dirpath = ckpt_path
  75                 self.checkpoint_callback.filename = '{epoch}'
  76                 os.makedirs(self.checkpoint_callback.dirpath, exist_ok=True)
  77         elif self.checkpoint_callback is False:
  78             self.checkpoint_callback = None
  79 
  80         self.ckpt_path = ckpt_path
  81 
  82         if self.checkpoint_callback:
  83             # set the path for the callbacks
  84             self.checkpoint_callback.save_function = self.save_checkpoint
  85 
  86             # if checkpoint callback used, then override the weights path
  87             self.weights_save_path = self.checkpoint_callback.dirpath
  88 
  89         # if weights_save_path is still none here, set to current working dir
  90         if self.weights_save_path is None:
  91             self.weights_save_path = self.default_root_dir
  92 
  93     def configure_early_stopping(self, early_stop_callback):
  94         if early_stop_callback is True or None:
  95             self.early_stop_callback = EarlyStopping(
  96                 monitor='val_loss',
  97                 patience=3,
  98                 strict=True,
  99                 verbose=True,
  100                 mode='min'
  101             )
  102             self.enable_early_stop = True
  103         elif not early_stop_callback:
  104             self.early_stop_callback = None
  105             self.enable_early_stop = False
  106         else:
  107             self.early_stop_callback = early_stop_callback
  108             self.enable_early_stop = True
  109 
  110     def configure_progress_bar(self):
  111         progress_bars = [c for c in self.callbacks if isinstance(c, ProgressBarBase)]
  112         if len(progress_bars) > 1:
  113             raise MisconfigurationException(
  114                 'You added multiple progress bar callbacks to the Trainer, but currently only one'
  115                 ' progress bar is supported.'
  116             )
  117         elif len(progress_bars) == 1:
  118             self.progress_bar_callback = progress_bars[0]
  119         elif self.progress_bar_refresh_rate > 0:
  120             self.progress_bar_callback = ProgressBar(
  121                 refresh_rate=self.progress_bar_refresh_rate,
  122                 process_position=self.process_position,
  123             )
  124             self.callbacks.append(self.progress_bar_callback)
  125         else:
  126             self.progress_bar_callback = None
  127
  ```
  --- 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/pytorch_lightning/trainer/callback_config.py b/pytorch_lightning/trainer/callback_config.py
  --- a/pytorch_lightning/trainer/callback_config.py
  +++ b/pytorch_lightning/trainer/callback_config.py
  @@ -49,10 +49,12 @@
                   if self.weights_save_path is not None:
                       save_dir = self.weights_save_path
   
  +                version = self.logger.version if isinstance(
  +                    self.logger.version, str) else f'version_{self.logger.version}'
                   ckpt_path = os.path.join(
                       save_dir,
                       self.logger.name,
  -                    f'version_{self.logger.version}',
  +                    version,
                       "checkpoints"
                   )
               else:
  
verification_info: {"golden_diff": "diff --git a/pytorch_lightning/trainer/callback_config.py b/pytorch_lightning/trainer/callback_config.py\n--- a/pytorch_lightning/trainer/callback_config.py\n+++ b/pytorch_lightning/trainer/callback_config.py\n@@ -49,10 +49,12 @@\n                 if self.weights_save_path is not None:\n                     save_dir = self.weights_save_path\n \n+                version = self.logger.version if isinstance(\n+                    self.logger.version, str) else f'version_{self.logger.version}'\n                 ckpt_path = os.path.join(\n                     save_dir,\n                     self.logger.name,\n-                    f'version_{self.logger.version}',\n+                    version,\n                     \"checkpoints\"\n                 )\n             else:\n", "issue": "Checkpoint adding \"version_\" at the start of the logger name\n**To reproduce :** \r\n```python\r\nlogger = pl.loggers.TensorBoardLogger(\r\n                save_dir='.',\r\n                version='my_name'\r\n                name='lightning_logs'\r\n            )\r\n\r\ntrainer = pl.Trainer(logger=logger, log_gpu_memory='all', max_epochs=10)\r\n```\r\n\r\n**Giving as a result:**\r\n\r\n-  /lightning_logs/my_name: Where is saved the logs\r\n-  /lightning_logs/version_my_name : Where is saved the checkpoints\r\n\r\n\r\n\r\n\r\n**Possible Explanation:** \r\nIt seems like the checkpoint saving add \"version_\" to the start of the name even if the name have been given as a parameter : \r\n\r\nhttps://github.com/PyTorchLightning/pytorch-lightning/blob/3e8f2d99a9951bfb5fc67a98614128317913be1d/pytorch_lightning/trainer/callback_config.py#L52-L57\r\n\r\nEven if in the Tensorboard Logger if the name is provided there is no \"version_\" prefix :\r\n\r\nhttps://github.com/PyTorchLightning/pytorch-lightning/blob/8b82ce09039e75f3fcb77a987c964249e38def3b/pytorch_lightning/loggers/tensorboard.py#L81\r\n\r\n\r\n\n", "before_files": [{"content": "import os\nfrom abc import ABC, abstractmethod\nfrom typing import Union, List\n\n\nfrom pytorch_lightning.callbacks import Callback, ModelCheckpoint, EarlyStopping, ProgressBarBase, ProgressBar\nfrom pytorch_lightning.loggers import LightningLoggerBase\nfrom pytorch_lightning.utilities.exceptions import MisconfigurationException\n\n\nclass TrainerCallbackConfigMixin(ABC):\n\n    # this is just a summary on variables used in this abstract class,\n    #  the proper values/initialisation should be done in child class\n    callbacks: List[Callback]\n    default_root_dir: str\n    logger: Union[LightningLoggerBase, bool]\n    weights_save_path: str\n    ckpt_path: str\n    checkpoint_callback: ModelCheckpoint\n    progress_bar_refresh_rate: int\n    process_position: int\n\n    @property\n    @abstractmethod\n    def slurm_job_id(self) -> int:\n        \"\"\"Warning: this is just empty shell for code implemented in other class.\"\"\"\n\n    @abstractmethod\n    def save_checkpoint(self, *args):\n        \"\"\"Warning: this is just empty shell for code implemented in other class.\"\"\"\n\n    def configure_checkpoint_callback(self):\n        \"\"\"\n        Weight path set in this priority:\n        Checkpoint_callback's path (if passed in).\n        User provided weights_saved_path\n        Otherwise use os.getcwd()\n        \"\"\"\n        ckpt_path = self.default_root_dir\n        if self.checkpoint_callback:\n            # init a default one\n            if self.logger is not None:\n                save_dir = (getattr(self.logger, 'save_dir', None) or\n                            getattr(self.logger, '_save_dir', None) or\n                            self.default_root_dir)\n\n                # weights_save_path overrides anything\n                if self.weights_save_path is not None:\n                    save_dir = self.weights_save_path\n\n                ckpt_path = os.path.join(\n                    save_dir,\n                    self.logger.name,\n                    f'version_{self.logger.version}',\n                    \"checkpoints\"\n                )\n            else:\n                ckpt_path = os.path.join(self.default_root_dir, \"checkpoints\")\n\n            # when no val step is defined, use 'loss' otherwise 'val_loss'\n            train_step_only = not self.is_overriden('validation_step')\n            monitor_key = 'loss' if train_step_only else 'val_loss'\n\n            if self.checkpoint_callback is True:\n                os.makedirs(ckpt_path, exist_ok=True)\n                self.checkpoint_callback = ModelCheckpoint(\n                    filepath=ckpt_path,\n                    monitor=monitor_key\n                )\n            # If user specified None in filepath, override with runtime default\n            elif isinstance(self.checkpoint_callback, ModelCheckpoint) \\\n                    and self.checkpoint_callback.dirpath is None:\n                self.checkpoint_callback.dirpath = ckpt_path\n                self.checkpoint_callback.filename = '{epoch}'\n                os.makedirs(self.checkpoint_callback.dirpath, exist_ok=True)\n        elif self.checkpoint_callback is False:\n            self.checkpoint_callback = None\n\n        self.ckpt_path = ckpt_path\n\n        if self.checkpoint_callback:\n            # set the path for the callbacks\n            self.checkpoint_callback.save_function = self.save_checkpoint\n\n            # if checkpoint callback used, then override the weights path\n            self.weights_save_path = self.checkpoint_callback.dirpath\n\n        # if weights_save_path is still none here, set to current working dir\n        if self.weights_save_path is None:\n            self.weights_save_path = self.default_root_dir\n\n    def configure_early_stopping(self, early_stop_callback):\n        if early_stop_callback is True or None:\n            self.early_stop_callback = EarlyStopping(\n                monitor='val_loss',\n                patience=3,\n                strict=True,\n                verbose=True,\n                mode='min'\n            )\n            self.enable_early_stop = True\n        elif not early_stop_callback:\n            self.early_stop_callback = None\n            self.enable_early_stop = False\n        else:\n            self.early_stop_callback = early_stop_callback\n            self.enable_early_stop = True\n\n    def configure_progress_bar(self):\n        progress_bars = [c for c in self.callbacks if isinstance(c, ProgressBarBase)]\n        if len(progress_bars) > 1:\n            raise MisconfigurationException(\n                'You added multiple progress bar callbacks to the Trainer, but currently only one'\n                ' progress bar is supported.'\n            )\n        elif len(progress_bars) == 1:\n            self.progress_bar_callback = progress_bars[0]\n        elif self.progress_bar_refresh_rate > 0:\n            self.progress_bar_callback = ProgressBar(\n                refresh_rate=self.progress_bar_refresh_rate,\n                process_position=self.process_position,\n            )\n            self.callbacks.append(self.progress_bar_callback)\n        else:\n            self.progress_bar_callback = None\n", "path": "pytorch_lightning/trainer/callback_config.py"}], "after_files": [{"content": "import os\nfrom abc import ABC, abstractmethod\nfrom typing import Union, List\n\n\nfrom pytorch_lightning.callbacks import Callback, ModelCheckpoint, EarlyStopping, ProgressBarBase, ProgressBar\nfrom pytorch_lightning.loggers import LightningLoggerBase\nfrom pytorch_lightning.utilities.exceptions import MisconfigurationException\n\n\nclass TrainerCallbackConfigMixin(ABC):\n\n    # this is just a summary on variables used in this abstract class,\n    #  the proper values/initialisation should be done in child class\n    callbacks: List[Callback]\n    default_root_dir: str\n    logger: Union[LightningLoggerBase, bool]\n    weights_save_path: str\n    ckpt_path: str\n    checkpoint_callback: ModelCheckpoint\n    progress_bar_refresh_rate: int\n    process_position: int\n\n    @property\n    @abstractmethod\n    def slurm_job_id(self) -> int:\n        \"\"\"Warning: this is just empty shell for code implemented in other class.\"\"\"\n\n    @abstractmethod\n    def save_checkpoint(self, *args):\n        \"\"\"Warning: this is just empty shell for code implemented in other class.\"\"\"\n\n    def configure_checkpoint_callback(self):\n        \"\"\"\n        Weight path set in this priority:\n        Checkpoint_callback's path (if passed in).\n        User provided weights_saved_path\n        Otherwise use os.getcwd()\n        \"\"\"\n        ckpt_path = self.default_root_dir\n        if self.checkpoint_callback:\n            # init a default one\n            if self.logger is not None:\n                save_dir = (getattr(self.logger, 'save_dir', None) or\n                            getattr(self.logger, '_save_dir', None) or\n                            self.default_root_dir)\n\n                # weights_save_path overrides anything\n                if self.weights_save_path is not None:\n                    save_dir = self.weights_save_path\n\n                version = self.logger.version if isinstance(\n                    self.logger.version, str) else f'version_{self.logger.version}'\n                ckpt_path = os.path.join(\n                    save_dir,\n                    self.logger.name,\n                    version,\n                    \"checkpoints\"\n                )\n            else:\n                ckpt_path = os.path.join(self.default_root_dir, \"checkpoints\")\n\n            # when no val step is defined, use 'loss' otherwise 'val_loss'\n            train_step_only = not self.is_overriden('validation_step')\n            monitor_key = 'loss' if train_step_only else 'val_loss'\n\n            if self.checkpoint_callback is True:\n                os.makedirs(ckpt_path, exist_ok=True)\n                self.checkpoint_callback = ModelCheckpoint(\n                    filepath=ckpt_path,\n                    monitor=monitor_key\n                )\n            # If user specified None in filepath, override with runtime default\n            elif isinstance(self.checkpoint_callback, ModelCheckpoint) \\\n                    and self.checkpoint_callback.dirpath is None:\n                self.checkpoint_callback.dirpath = ckpt_path\n                self.checkpoint_callback.filename = '{epoch}'\n                os.makedirs(self.checkpoint_callback.dirpath, exist_ok=True)\n        elif self.checkpoint_callback is False:\n            self.checkpoint_callback = None\n\n        self.ckpt_path = ckpt_path\n\n        if self.checkpoint_callback:\n            # set the path for the callbacks\n            self.checkpoint_callback.save_function = self.save_checkpoint\n\n            # if checkpoint callback used, then override the weights path\n            self.weights_save_path = self.checkpoint_callback.dirpath\n\n        # if weights_save_path is still none here, set to current working dir\n        if self.weights_save_path is None:\n            self.weights_save_path = self.default_root_dir\n\n    def configure_early_stopping(self, early_stop_callback):\n        if early_stop_callback is True or None:\n            self.early_stop_callback = EarlyStopping(\n                monitor='val_loss',\n                patience=3,\n                strict=True,\n                verbose=True,\n                mode='min'\n            )\n            self.enable_early_stop = True\n        elif not early_stop_callback:\n            self.early_stop_callback = None\n            self.enable_early_stop = False\n        else:\n            self.early_stop_callback = early_stop_callback\n            self.enable_early_stop = True\n\n    def configure_progress_bar(self):\n        progress_bars = [c for c in self.callbacks if isinstance(c, ProgressBarBase)]\n        if len(progress_bars) > 1:\n            raise MisconfigurationException(\n                'You added multiple progress bar callbacks to the Trainer, but currently only one'\n                ' progress bar is supported.'\n            )\n        elif len(progress_bars) == 1:\n            self.progress_bar_callback = progress_bars[0]\n        elif self.progress_bar_refresh_rate > 0:\n            self.progress_bar_callback = ProgressBar(\n                refresh_rate=self.progress_bar_refresh_rate,\n                process_position=self.process_position,\n            )\n            self.callbacks.append(self.progress_bar_callback)\n        else:\n            self.progress_bar_callback = None\n", "path": "pytorch_lightning/trainer/callback_config.py"}]}