Skip to content

PyTorch breaks Matplotlib #2155

@hongzimao

Description

@hongzimao
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import torch

fig = plt.figure()
plt.plot([1,2])
fig.savefig('test.pdf')

Running this simple python code will have error *** Error in 'python': free(): invalid pointer: 0x00007f5ba8129ac0 *** (omit the backtrace output). It breaks at fig.savefig('test.pdf').

OS Ubuntu 16.04.2 LTS, Python version 2.7.12, PyTorch version 0.1.12_2, Matplotlib version 2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions