簡體   English   中英

Kernel 在有大量可用 RAM 時被殺死

[英]Kernel killed while there is plenty of available 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。 但是,當我運行程序時,kernel 會自動終止並重新啟動並顯示:

正在重啟 kernel...

[SpyderKernelApp] 警告 | 沒有這樣的通訊:25562a62516411ebbc72f17b9468ff8d

為什么這個程序似乎使用了我筆記本電腦的所有 RAM? 我在雙啟動上運行,有足夠的存儲空間,除了 spyder 之外沒有其他主要程序在后台運行。 你知道為什么會出現這種問題嗎?

非常感謝 !

我google了這個問題,找到了答案。 很多人遇到這個問題,在github中的建議是

請更新到 Spyder 4.1.4。 這個問題應該在那個版本中得到解決。

有人說已經解決了——需要為QT添加擴展依賴。 我認為該鏈接可以幫助您解決問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM