Python 进程在 PyCharm 中以退出代码 137 结束

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43268156/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 22:45:02  来源:igfitidea点击:

Process finished with exit code 137 in PyCharm

pythonpycharmxgboost

提问by shawe

When I stop the script manually in PyCharm, process finished with exit code 137. But I didn't stop the script. Still got the exit code 137. What's the problem?

当我在 PyCharm 中手动停止脚本时,进程以退出代码 137 结束。但我没有停止脚本。还是出现了退出码137,是什么问题?

Python version is 3.6, process finished when running xgboost.train() method.

Python 版本是 3.6,运行 xgboost.train() 方法时进程完成。

回答by ykaner

Exit code 137 means that your process was killed by (signal 9) SIGKILL. In the case you manually stopped it - there's your answer.

退出代码 137 表示您的进程被 (signal 9) 杀死SIGKILL。如果您手动停止它 - 这就是您的答案。

If you didn't manually stop the script and still got this error code, then the script was killed by your OS. In most of the cases, it is caused by excessive memory usage.

如果您没有手动停止脚本并仍然收到此错误代码,则该脚本已被您的操作系统杀死。在大多数情况下,它是由内存使用过多引起的。

回答by Camilo

I had the same error. In my case was related to excessive memory usage. Solved after reseting/cleaning my cache data adding the following code for every variable that will not be used anymore :

我有同样的错误。就我而言,这与内存使用过多有关。重置/清理缓存数据后解决,为每个不再使用的变量添加以下代码:

MyVariableName = None

回答by user11009049

It's not always a memory issue. In my case subprocess.Popenwas utilized and it was throwing the error as 137 which looks like signalKILL and the cause is definitely not the memory utilization, because during the runtime it was hardly using 1% of memory use. This seems to be a permission issue after more investigation. I simply moved the scripts from /home/ubuntuto the root directory.

这并不总是内存问题。在我的情况下subprocess.Popen,它被利用了,它抛出的错误是 137,看起来像 signalKILL,原因绝对不是内存利用率,因为在运行时它几乎没有使用 1% 的内存使用量。经过更多调查,这似乎是一个权限问题。我只是将脚本从/home/ubuntu根目录移到了根目录。

回答by BrB

{In my experience}

{在我的经验中}

this is because of Memory issue. When I try to train ml model using sklearn fit with full data set , it abruptly breaks and gives whereas with small data it works fine.

这是因为内存问题。当我尝试使用 sklearn fit with full data set 训练 ml 模型时,它突然中断并给出,而对于小数据,它工作正常。

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)Interestingly this is not caught in Exception block either

进程以退出代码 137 结束(被信号 9:SIGKILL 中断)有趣的是,这也没有在异常块中捕获

回答by Alex Horvath

My python process get killed with the 137 error code because my Docker for Windows memory limit was set too low.

我的 python 进程被 137 错误代码杀死,因为我的 Docker for Windows 内存限制设置得太低。