plt导致python程序终止Aborted (core dumped)
用Keras、TensorFlow、PyTorch的模型预测时,如果用了matplotlib显示图片,一直循环会导致plt占内存过多:
terminate called after throwing an instance of ‘std::bad_alloc’
Aborted (core dumped)
各种尝试分析问题不在Keras、TensorFlow、PyTorch,而在于matplotlib打开figure过多
因此用:
plt.close('all')