Thursday, 25 November 2021

pycharm error happening at random time: Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

I am working with pycharm community on a tensorflow model with keras backend, sometimes this error appears in a random time, specially after I call pyplot and close the window:

Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x7ff6406fad30>>
Traceback (most recent call last):
  File "/usr/lib/python3.6/tkinter/__init__.py", line 3507, in __del__
    self.tk.call('image', 'delete', self.name)
    RuntimeError: main thread is not in main loop

After this error, I need to close the python console and load my data again which is time-consuming (the data is a big dataset and the memory usage is considerable)

How do I resolve this problem?

UPDATE: Here is the plot code:

import matplotlib
matplotlib.use('TkAgg')
from matplotlib import pyplot as plt
import numpy as np

data = np.ones((256,256))
fig = plt.figure()
ax = fig.add_subplot(111)
temp = np.transpose(data)
plt.title('title')
im = ax.imshow((temp), aspect='auto')
fig.colorbar(im)
plt.axes()

data2 = np.ones((256,256))
fig = plt.figure()
ax = fig.add_subplot(111)
temp = np.transpose(data2)
plt.title('title')
im = ax.imshow((temp), aspect='auto')
fig.colorbar(im)
plt.axes()


from pycharm error happening at random time: Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

No comments:

Post a Comment