pythonlinux-kernelramcomm

Kernel killed while there is plenty of available RAM


I am running a python program transforming all the .png files in a folder to a gif with the following code:

    import glob
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True

# filepaths
fp_in = path_monthly + '/' + "*.png"
fp_out = path_directory + '/' + "Monthly_MB.gif"

# https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#gif
img, *imgs = [Image.open(f) for f in sorted(glob.glob(fp_in))]
img.save(fp=fp_out, format='GIF', append_images=imgs,
         save_all=True, duration=600, loop=0)


import glob
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True

# filepaths
fp_in = path_yearly + '/'  + "*.png"
fp_out = path_directory + '/' + "Yearly_MB.gif"

# https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#gif
img, *imgs = [Image.open(f) for f in sorted(glob.glob(fp_in))]
img.save(fp=fp_out, format='GIF', append_images=imgs,
         save_all=True, duration=600, loop=0)

There are 193 png files, the total weight is 500Mb. My laptop has 16Gb of RAM. However, when I run the program, the kernel is automatically killed and restarted and displays:

Restarting kernel...

[SpyderKernelApp] WARNING | No such comm: 25562a62516411ebbc72f17b9468ff8d

How come this program seems to use all the RAM of my laptop ? I am running on a dual-boot, with plenty enough storage and no other major program running in the background other than spyder. Do you have an idea why this kind of problem appears ?

Thanks a lot !


Solution

  • I google the problem, and find the answer. Lots of people meet the problem, and in github the suggestion is

    Please update to Spyder 4.1.4. This problem should be fixed in that version.

    And some people said it has been solved - needed to add the extended dependencies for QT. I think that link can help you solve your problem.