Lightning-AI / Lightning-AI/pytorch-lightning

Group the metrics in Tensorboard

Open
#21,578 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug logger: tensorboard ver: 2.5.x
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Bug description

I cannot understand what needs to be done to group the graphs for the same metric:

```python
self.log_dict(
dictionary={'losses/a': 0.1, 'losses/b': 0.2},
batch_size=1,
add_dataloader_idx=False,
prog_bar=False,
on_step=True,
on_epoch=False,
sync_dist=False,
rank_zero_only=True,
)

self.log(
name='losses/c',
value=0.3,
batch_size=1,
add_dataloader_idx=False,
prog_bar=False,
on_step=True,
on_epoch=False,
sync_dist=False,
rank_zero_only=True,
)

self.log(
name='losses/d',
value=0.3,
batch_size=1,
add_dataloader_idx=False,
prog_bar=False,
on_step=True,
on_epoch=False,
sync_dist=False,
rank_zero_only=True,
)
```

Result in:
Image

I would really like to see all 4 lines on the same plot.

version: 2.6.1

### What version are you seeing the problem on?

v2.5

### Reproduced in studio

_No response_

### How to reproduce the bug

```python
self.log_dict(
dictionary={'losses/a': 0.1, 'losses/b': 0.2},
batch_size=1,
add_dataloader_idx=False,
prog_bar=False,
on_step=True,
on_epoch=False,
sync_dist=False,
rank_zero_only=True,
)

self.log(
name='losses/c',
value=0.3,
batch_size=1,
add_dataloader_idx=False,
prog_bar=False,
on_step=True,
on_epoch=False,
sync_dist=False,
rank_zero_only=True,
)

self.log(
name='losses/d',
value=0.3,
batch_size=1,
add_dataloader_idx=False,
prog_bar=False,
on_step=True,
on_epoch=False,
sync_dist=False,
rank_zero_only=True,
)
```

### Error messages and logs

```
# Error messages and logs here please
```

### Environment

Current environment

```
#- PyTorch Lightning Version: 2.6.1
#- PyTorch Version: 2.9.1
#- Python version: 3.12
#- OS: Linux
#- CUDA/cuDNN version: 13.0
#- How you installed Lightning: poetry
```

### More info

_No response_

cc @ethanwharris @lantiga

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report does not name a file or test. Start by reproducing the behavior with the provided self.log_dict and self.log calls, then trace the TensorBoard logging entry points; done means the four losses series appear together on one plot without changing the reported metric names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
data-visualization, observability
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.