I have been using w&b for a few months and have had a great experience with it. However, I have had some trouble with including the diagram in my report. Under *more actions > export panel … * there exist options for exporting the panel to PNG, SVG, PDF, and CSV. I want to export the panel to PDF with vectorized graphics and text but the PDF export seems to simply render the panel to PNG.
What I have tried:
- exporting to SVG, but I was not able to convert this format to pdf or any other format suitable for my LaTeX report. I have been unable to use SVG files in my LaTeX report directly.
- creating a report of the panel and downloading the report as LaTeX, but again it renders the plots as PNG which is not desired in my case.
Perhaps I am missing something, but as a final resort I have tried recreating the plots in wandb with the Export API in the following code snippet:
import wandb
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
api = wandb.Api()
# Project is specified by <entity/project-name>
runs = api.runs("<wandb-id>/<entity-project-name>")
hist_list = []
for run in runs:
if not 'val/loss' in run.summary:
continue
name = run.config['model']['_target_'].split('.')[-1]
hist = run.history(keys=['epoch', 'val/loss'])
hist['name'] = name
hist_list.append(hist)
df = pd.concat(hist_list, ignore_index=True)
df = df.query("`val/loss` != 'NaN'")
sns.lineplot(x="epoch", y="val/loss", hue="name", data=df)
plt.show()
The script takes a long time to run (10 seconds) and comparing the output with the panel in the w&b dashboard we have the following two plots
The two plots have a noticeable difference. So I have two questions:
- Is it possible to export a panel to pdf with selectable text?
- If not, is there any reference for recreating the plots in wandb?
Any help is appreciated
EDIT
I found a github thread that explains my problem a bit better: Custom Charts: Export Panel Feature · Issue #1446 · wandb/client · GitHub