【问题标题】:Kernel killed while there is plenty of available RAM有大量可用 RAM 时内核被杀死
【发布时间】:2021-01-08 03:53:42
【问题描述】:

我正在运行一个 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 之外没有其他主要程序在后台运行。你知道为什么会出现这种问题吗?

非常感谢!

【问题讨论】:

  • 您使用的是 64 位操作系统还是 32 位操作系统?
  • 我使用的是 64 位操作系统。我还在一个服务器上运行它,当没有人使用它时,它设法让它运行

标签: python linux-kernel ram comm


【解决方案1】:

我用谷歌搜索这个问题,然后找到答案。很多人遇到这个问题,github 的建议是

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

还有人说已经解决了——需要为QT添加扩展依赖。我认为该链接可以帮助您解决问题。

【讨论】:

    猜你喜欢
    • 2014-10-20
    • 2018-01-24
    • 1970-01-01
    • 1970-01-01
    • 2017-06-17
    • 2013-04-29
    • 2013-04-24
    • 1970-01-01
    • 2020-01-06
    相关资源
    最近更新 更多