这是什么"杀了"错误意味着在Python?

时间:2015-08-04 16:03:02

标签: python image pickle kill

我不了解这里发生的事情。有人可以解释为什么Python3.4"杀死"这个脚本:

def __init__(self, target, data_flatten, data, 
              tf, hlf, white, robert, sobel, scharr):
    self.data_flatten = data_flatten
    self.target = target
    self.data = data
    self.tf = tf
    self.hlf = hlf
    self.white = white
    self.robert = robert
    self.sobel = sobel
    self.scharr = scharr

with open('PI0_Electron_Mixed_2000.pickle', 'wb') as output:
    pickle.dump(PI0_Electron_Mixed_2000, output)

以下是我在终端中运行脚本时的输出:

[jdoe@edne01 ~]$ cd PycharmProjects/ImageReader
[jdoe@edne01 ImageReader]$ python3.4 DataCompiler.py 
Killed
[jdoe@edne01 ImageReader]$

那么到底发生了什么,有人可以解释一下吗?

2 个答案:

答案 0 :(得分:4)

最可能的原因可能是您的进程超出了允许使用的系统资源量的限制。根据您的操作系统和配置,这可能意味着您有太多打开的文件,使用了太多的文件系统空间或其他东西。最可能的是你的程序使用了太多内存。当内存分配开始失败时,系统发送了一个kill信号给使用了太多内存的进程,而不是冒着破坏的风险。

答案 1 :(得分:-1)

在读取大文件时,这也发生在我身上。您可以尝试重新启动系统,这应该会停止。