当有足够的可用RAM时内核被杀死



我正在运行一个python程序,用以下代码将文件夹中的所有.png文件转换为gif:

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)

共有193个png文件,总重量为500Mb。我的笔记本电脑有16Gb的RAM。然而,当我运行该程序时,内核会自动终止并重新启动,并显示:

正在重新启动内核。。。

[SpyderKernelApp]警告|没有这样的命令:25562a62516411ebbc72f17b9468ff8d

为什么这个程序似乎使用了我笔记本电脑的所有RAM?我在双引导上运行,有足够的存储空间,除了spyder之外,没有其他主要程序在后台运行。你知道为什么会出现这种问题吗?

非常感谢!

我用谷歌搜索这个问题,并找到答案。很多人都遇到了这个问题,在github中,建议是

请更新至Spyder 4.1.4。这个问题应该在那个版本中得到解决。

一些人说它已经解决了——需要添加QT的扩展依赖项。我认为这个链接可以帮助你解决问题。

最新更新