Skip to content

Compatibility with matplotlib 3.1.1 #18

@os1a

Description

@os1a

Hi,
I have experienced some problems when using the tfplot using the new version of matplotlib.
More details about the error are:

Traceback (most recent call last):
  File "tmp.py", line 169, in <module>
    main()
  File "tmp.py", line 160, in main
    summary = session.run(summary_op)
  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run
    run_metadata_ptr)
  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
    run_metadata)
  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnknownError: AttributeError: 'FigureCanvasBase' object has no attribute 'tostring_argb'
Traceback (most recent call last):

  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tensorflow/python/ops/script_ops.py", line 209, in __call__
    ret = func(*args)

  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tfplot/ops.py", line 101, in _render_image
    image = figure.to_array(fig)

  File "/home/makansio/venv/tf1.14/lib/python3.6/site-packages/tfplot/figure.py", line 92, in to_array
    img = np.frombuffer(fig.canvas.tostring_argb(), dtype=np.uint8)

AttributeError: 'FigureCanvasBase' object has no attribute 'tostring_argb'

I have solved it by reinstalling an older version of matplotlib == 3.0.2

Best,
Osama

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions