Skip to content

KeyError on run-time #17

Open
Open
@wookayin

Description

@wookayin

The following KeyError might happen during the execution (e.g. sess.run()) of plot functions, where an exception is thrown outside:

KeyError: (1.0, 0.01, '0.010', 'black', 'center_baseline', 'left', -1142507319491788459, None, None, 100.0, <weakref at 0x7fadaec55db8; to 'RendererAgg' at 0x7fadaca0b198>, 1.2)
Detailed stacktrace (click to expand)
  File "$PREFIX/lib/python3.6/site-packages/tfplot/ops.py", line 80, in _render_image
    image = figure.to_array(fig)

  File "$PREFIX/lib/python3.6/site-packages/tfplot/figure.py", line 81, in to_array
    fig.canvas.draw()

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py", line 402, in draw
    self.figure.draw(self.renderer)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/figure.py", line 1649, in draw
    renderer, self, artists, self.suppressComposite)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/axes/_base.py", line 2628, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
    a.draw(renderer)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/axis.py", line 1187, in draw
    renderer)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/axis.py", line 1125, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/text.py", line 930, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/text.py", line 430, in _get_layout
    self._cached[key] = ret

  File "$PREFIX/lib/python3.6/site-packages/matplotlib/cbook/__init__.py", line 623, in __setitem__
    del self[self._killkeys[0]]

I suspect this would be a multithread-related issue (matplotlib is not thread-safe). The only workaround I have at this point is to simply ignore the exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions