question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging histgram does not work

See original GitHub issue

wandb --version && python --version && uname

  • Weights and Biases version: 0.9.4
  • Python version: 3.6.9
  • Operating System: Ubuntu

Description

I am trying to log a histogram into wandb. The run appears on wandb, but the histogram is not there. Other stuff such as scalars or Images is logged properly. What is wrong?

What I Did

` import wandb import numpy as np

wandb.init(entity=“MyEntity”, project=“my project”, name=“testing”) a = np.random.randn(100) hist = np.histogram(a) h = wandb.Histogram(np_histogram=hist) wandb.log({“gradients”: wandb.Histogram(np_histogram=hist)}) `

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

4reactions
LeonOstrezcommented, Dec 14, 2021

@aidanjdonohue i did, but with previously storing to var, so something like this:

hist = np.histogram(data)
wandb_data['my_histogram'] = wandb.Histogram(np_histogram=hist)
wandb.log(wandb_data, step=epoch)

After looking into it more, i realized that if i open only that specific experiment/run in wandb (meaning that url would be: https://wandb.ai/USER/PROJECT/runs/RUNID?workspace=user-USER) i can find histogram, but if i am looking in project/workspace (where on left side is list of all experiments, meaning url is https://wandb.ai/USER/PROJECT?workspace=user-USER) then histogram doesnt exist.

I contacted customer service and after explaining it all in details got this response:

I’ll be taking on this ticket. I was able to recreate your situation.

wandb.Histogram behaves more similarly to a line plot as it does than a rich media type such as wandb.Image. This means that the 1d numpy array that is stored for your histogram will be aligned along the provided step access (creating a 2d array for which we plot on). That is why upon hover of each step you can see a floating tooltip which displays the Histogram.

As a result the histogram plot with multiple steps will not be plotted in the project page as there is no media panel chart which aligns (run x step x 1d histogram). I have made a ticket for the engineers about the addition of the step slider for histogram as an available behavior.

In the meantime, If you would like a histogram to be plotted with a step slider. I believe it would be best to log a graph (using our wandb.Plotly data type as an example) or image of the histogram for use with step slider.

Let me know if there is any confusion!

I hope this helps someone else with same issue 🤞

3reactions
LeonOstrezcommented, Nov 25, 2021

I’m getting same issue. The run appears on wandb, but the histogram is not there while all other tables/charts are ok.

I tried generating histogram from sequence:

wandb.Histogram([1,2,3])

and also i tried using np.histogram

hist = np.histogram(data)
wandb.Histogram(np_histogram=hist)

Weights and Biases version: 0.12.7 Python version: 3.8.10 Operating System: Ubuntu

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging histgram does not work · Issue #1211 - GitHub
I am trying to log a histogram into wandb. The run appears on wandb, but the histogram is not there. Other stuff such...
Read more >
plotting a histogram on a Log scale with Matplotlib
For the record, I have imported pandas, numpy, and matplotlib and specified that the plot should be inline.
Read more >
New histogram features in Cloud Logging to troubleshoot faster
Using the histogram in Logs Explorer, you can quickly visualize log volumes over time to help spot anomalies, detect when errors started and...
Read more >
Histogram Guidelines
Don't Use the Same Histogram Logging Call in Multiple Places; Use Fixed Strings When Using Histogram Macros; Don't Use Same Inline String in...
Read more >
How to use full-range log volume histograms with Grafana Loki
In the freshly released Grafana 8.4, we've enabled the full-range log volume histogram for the Grafana Loki data source by default.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found