Repository: Lightning-AI/pytorch-lightning

Issue:
How to remove `v_num` from the progress bar ?
Version: 0.7.3

The `v_num` is automatically added to progress_bar when some logger is used
It is not much a problem for tensorboard when v_num is just a simple number
But v_num for mlfow takes a lot of space

Traning step
```
def training_step(self, batch, batch_nb):
    ....
    log = { "trn_loss": 0.1, "lr": 0.001 }
    return {"loss": loss, "log": log, "progress_bar": log}
```

Progress bar when using with mlflow logger
```
 [00:33<00:46, 1.62s/it, loss=0.740, lr=8e-6, trn_loss=0.659, v_num=18_28bc973b1f0e42e8b4d664d1ef7812f6]
```

Also, `loss` is automatically added to `progress_bar`



Discussion:
loss and trn_loss are the same. you’re duplicating work. 
maybe we can show only the last k letters for other exps
It may be a good default to show loss and v_num in progress bar when no `progress_bar` property in the return dict. 
But here I explicitly ask to show only my trn_loss and lr (whatever they are). Why does package add loss and v_num ?

normally we run many (hundreds) of experiments to find a good set of hyperparams or a model that works for our task. as such, it’s very useful to know which experiment version you are running - v_num (experiment version number)
Thanks a lot @williamFalcon  for the explanation. 
> maybe we can show only the last k letters for other exps

That should work.
Side question: is the meaning of v_num documented anywhere in the introduction guide? It looks very mysterious to me until I read this post. 
@DKandrew mind share your proposal how would you describe in a PR?
@Borda Do you mean where to introduce `v_num`? I think a good place would be https://pytorch-lightning.readthedocs.io/en/latest/introduction_guide.html the "Train on CPU" section. That is the first time when we (beginner) encounter the progress bar. 
Little bit of a hack but you can remove it manually by adding the following method in your lightning module:
```
def get_progress_bar_dict(self):
    tqdm_dict = super().get_progress_bar_dict()
    if 'v_num' in tqdm_dict:
        del tqdm_dict['v_num']
    return tqdm_dict
```
 I also had no idea what v_num was until I read William's comment above. 

@Borda Would renaming it to `version` be a solution?

Also, if it comes from the logger's `version` attribute then that's another reason to rename it (from `v_num` to `version`) since that isn't necessarily a number.

Resolving patch:
diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py
--- a/pytorch_lightning/core/lightning.py
+++ b/pytorch_lightning/core/lightning.py
@@ -1544,7 +1544,6 @@ def on_save_checkpoint(self, checkpoint: Dict[str, Any]) -> None:
         Example:
             .. code-block:: python
 
-
                 def on_save_checkpoint(self, checkpoint):
                     # 99% of use cases you don't need to implement this method
                     checkpoint['something_cool_i_want_to_save'] = my_cool_pickable_object
@@ -1558,7 +1557,23 @@ def on_save_checkpoint(self, checkpoint):
 
     def get_progress_bar_dict(self) -> Dict[str, Union[int, str]]:
         r"""
-        Additional items to be displayed in the progress bar.
+        Implement this to override the default items displayed in the progress bar.
+        By default it includes the average loss value, split index of BPTT (if used)
+        and the version of the experiment when using a logger.
+
+        .. code-block::
+
+            Epoch 1:   4%|▎         | 40/1095 [00:03<01:37, 10.84it/s, loss=4.501, v_num=10]
+
+        Here is an example how to override the defaults:
+
+        .. code-block:: python
+
+            def get_progress_bar_dict(self):
+                # don't show the version number
+                items = super().get_progress_bar_dict()
+                items.pop("v_num", None)
+                return items
 
         Return:
             Dictionary with the items to be displayed in the progress bar.
@@ -1572,7 +1587,10 @@ def get_progress_bar_dict(self) -> Dict[str, Union[int, str]]:
             tqdm_dict['split_idx'] = self.trainer.split_idx
 
         if self.trainer.logger is not None and self.trainer.logger.version is not None:
-            tqdm_dict['v_num'] = self.trainer.logger.version
+            version = self.trainer.logger.version
+            # show last 4 places of long version strings
+            version = version[-4:] if isinstance(version, str) else version
+            tqdm_dict['v_num'] = version
 
         return tqdm_dict
 


Test patch: