Hi, I am getting the below error when trying to plot a radar chart using matplotlib
plot object via wandb.log()
. I can generate the plot successfully and save it to a local file so the plotting code works fine. There seems to be some error when converting the matplotlib plot to plotly as inferred from the stack trace below.
matplotlib version: 3.5.0
wandb version: 0.15.10
plotly version: 5.16.1
Stacktrace -
Traceback (most recent call last):
File "/mnt/eval/main.py", line 159, in <module>
wandb.log({'radar_chart' : fig })
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_run.py", line 419, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_run.py", line 370, in wrapper_fn
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_run.py", line 360, in wrapper
return func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_run.py", line 1792, in log
self._log(data=data, step=step, commit=commit)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_run.py", line 1567, in _log
self._partial_history_callback(data, step, commit)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_run.py", line 1439, in _partial_history_callback
self._backend.interface.publish_partial_history(
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/interface/interface.py", line 528, in publish_partial_history
data = history_dict_to_json(run, data, step=user_step, ignore_copy_err=True)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/data_types/utils.py", line 52, in history_dict_to_json
payload[key] = val_to_json(
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/data_types/utils.py", line 86, in val_to_json
val = Plotly.make_plot_media(val)
File "/usr/local/lib/python3.10/dist-packages/wandb/sdk/data_types/plotly.py", line 49, in make_plot_media
val = util.matplotlib_to_plotly(val)
File "/usr/local/lib/python3.10/dist-packages/wandb/util.py", line 513, in matplotlib_to_plotly
return tools.mpl_to_plotly(obj)
File "/tmp/.local/lib/python3.10/site-packages/plotly/tools.py", line 111, in mpl_to_plotly
matplotlylib.Exporter(renderer).run(fig)
File "/tmp/.local/lib/python3.10/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 53, in run
self.crawl_fig(fig)
File "/tmp/.local/lib/python3.10/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 124, in crawl_fig
self.crawl_ax(ax)
File "/tmp/.local/lib/python3.10/site-packages/plotly/matplotlylib/mplexporter/exporter.py", line 128, in crawl_ax
with self.renderer.draw_axes(ax=ax, props=utils.get_axes_properties(ax)):
File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
return next(self.gen)
File "/tmp/.local/lib/python3.10/site-packages/plotly/matplotlylib/mplexporter/renderers/base.py", line 57, in draw_axes
self.open_axes(ax=ax, props=props)
File "/tmp/.local/lib/python3.10/site-packages/plotly/matplotlylib/renderer.py", line 168, in open_axes
bottom_spine = mpltools.get_spine_visible(ax, "bottom")
File "/tmp/.local/lib/python3.10/site-packages/plotly/matplotlylib/mpltools.py", line 366, in get_spine_visible
spine = ax.spines[spine_key]
File "/tmp/.local/lib/python3.10/site-packages/matplotlib/spines.py", line 572, in __getitem__
return self._dict[key]
KeyError: 'bottom'