8000 [Feature]: Display two curves in one graph? · Issue #4449 · wandb/wandb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Feature]: Display two curves in one graph? #4449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Freed-Wu opened this issue Nov 4, 2022 · 11 comments
Open

[Feature]: Display two curves in one graph? #4449

Freed-Wu opened this issue Nov 4, 2022 · 11 comments
Labels
a:sdk Area: sdk related issues c:sdk:tensorboard Component: Tensorboard - everything related to syncing tensorboard ty:feature type of the issue is a feature request

Comments

@Freed-Wu
Copy link
Freed-Wu commented Nov 4, 2022

Description

#!/usr/bin/env python
"""main."""
import wandb
from torch.utils.tensorboard.writer import SummaryWriter

model = image_models["mbt2018"](pretrained=True, quality=6)

log_dir = '/output/logs'

name = '5'
wandb.init(project="my-test-project-2", dir=log_dir, name=name, id=name,
           config={"learning_rate": 0.001, "epochs": 100, "batch_size": 128},
           sync_tensorboard=True)

writer = SummaryWriter(log_dir=log_dir)

writer.add_scalars('metrics/loss', {'train': 20, 'val': 100}, 0)
writer.add_scalars('metrics/loss', {'train': 10, 'val':  50}, 1)

# Optional
wandb.finish()

Can it display curves of same tag to one graph?

This is wandb:

screen-2022-11-04-22-44-28

This is tensorboard:

screen-2022-11-04-22-44-06

Suggested Solution

/

Alternatives

No response

Additional Context

No response

@Freed-Wu Freed-Wu added the ty:feature type of the issue is a feature request label Nov 4, 2022
@Freed-Wu Freed-Wu changed the title [Feature]: Dispaly two curves in one graph? [Feature]: Display two curves in one graph? Nov 4, 2022
@ramit-wandb
Copy link
Contributor

Hi @Freed-Wu,

Yup, this is already possible. You can read about it in our docs here : https://docs.wandb.ai/ref/app/features/panels/line-plot#compare-two-metrics-on-one-chart

@Freed-Wu
Copy link
Author
Freed-Wu commented Nov 7, 2022

Can it support tensorboard's add_scalars?

@ramit-wandb
Copy link
Contributor

Hey @Freed-Wu,

Yes, add_scalar from tensorboard is supported.

@Freed-Wu
Copy link
Author
Freed-Wu commented Nov 14, 2022

I mean can it display multi curves in one graph like add_scalars?

@Freed-Wu
Copy link
Author

That is how can wandb display similar result with tensorboard? #4449 (comment)

@ramit-wandb
Copy link
Contributor

Hey @Freed-Wu,

As I mentioned before, multiple curves are already supported. You will have to do some manual work to get these exactly the way you need them however. Here is a video to aid you with how to do this for any 2 plots:

Screen.Recording.2022-11-15.at.12.31.32.AM.mov

@wandb wandb deleted a comment from exalate-issue-sync bot Nov 17, 2022
@wandb wandb deleted a comment from exalate-issue-sync bot Nov 17, 2022
@ramit-wandb
Copy link
Contributor

​Hi @Freed-Wu, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

@oshapio
Copy link
oshapio commented Apr 12, 2023

Is it possible to do this automatically? Manually fiddling isn't ideal when many metrics are logged. It also liters workspace and requires deleting 'standalone', ungroupped graphs. It would be nice if logging a dict (with maybe additional flag group to not break things) would group things automatically as OP showed.

@fiskrt
Copy link
fiskrt commented May 8, 2023

I agree that this should be done automatically, since it's impractical and error prone to do this for every single figure. Especially when dealing with more than two curves. Suggested solution: copy tensorboard's functionality.

@OliEfr
Copy link
OliEfr commented Mar 28, 2024

I would also agree that it would be nice to do this automatically.

@kptkin kptkin reopened this Mar 28, 2024
@kptkin kptkin added a:sdk Area: sdk related issues c:define-metric labels Mar 28, 2024
@kptkin kptkin added c:sdk:custom-charts Component: Custom Charts and define_metric - wandb.plot and rest of vega based custom charts and removed c:define-metric labels Sep 1, 2024
@kptkin kptkin added c:sdk:tensorboard Component: Tensorboard - everything related to syncing tensorboard and removed c:sdk:custom-charts Component: Custom Charts and define_metric - wandb.plot and rest of vega based custom charts labels Oct 19, 2024
@garrett361
Copy link
garrett361 commented May 22, 2025

Is there an update on this? I would also love this functionality.

This is also already done for system metrics like GPU power usage for multi-gpu runs. Can't we do the same for other metrics?

Image

I tried to look in the wandb code to see how these system metrics are reported, but couldn't see anything useful for reporting other metrics similarly. Also not sure if these System metrics are just special-cased in the UI.

CC @kptkin @ramit-wandb

Related: #3035

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:sdk Area: sdk related issues c:sdk:tensorboard Component: Tensorboard - everything related to syncing tensorboard ty:feature type of the issue is a feature request
Projects
None yet
Development

No branches or pull requests

7 participants
0