sha*_*awe 36 python pycharm xgboost
当我在PyCharm中手动停止脚本时,进程以退出代码137完成.但是我没有停止脚本.仍然有退出代码137.有什么问题?
Python版本为3.6,运行xgboost.train()方法时完成.
小智 35
退出代码137表示您的进程被杀死SIGKILL
.在您手动停止它的情况下 - 这是您的答案.
如果您没有手动停止脚本并仍然收到此错误代码,则脚本将被您的操作系统杀死.在大多数情况下,它是由过多的内存使用引起的.
小智 16
如果您使用的是 Ubuntu,请增加 SWAP 内存。它会起作用的。使用htop查看SWAP使用情况,满了会报错137。
{在我的经验中}
这是因为内存问题。当我尝试使用 sklearn fit with full data set 训练 ml 模型时,它突然中断并给出,而对于小数据,它工作正常。
进程以退出代码 137 结束(被信号 9:SIGKILL 中断) 有趣的是,这也没有在异常块中捕获
小智 8
就我而言,我的 RAM 耗尽了,无论是真实的还是虚拟的。
\n将您的数据分割成小块或扩展您的虚拟内存。
\n我选择后者。
\n以下 scipts 适用于我的 ubuntu 20.04 TLS。
\n# disable the use of swap\nsudo swapoff -a\n\n# create the SWAP file. Make sure you have enough space on the hard disk.\n# here is my size, the total size is bs*count B\nsudo dd if=/dev/zero of=/swapfile bs=1024 count=136314880 status=progress\n# output:\n# 139458259968 bytes (139 GB, 130 GiB) copied, 472 s, 295 MB/s\n# 136314880+0 records in\n# 136314880+0 records out\n# 139586437120 bytes (140 GB, 130 GiB) copied, 472.372 s, 296 MB/s\n\n# Mark the file as SWAP space:\nsudo mkswap /swapfile\n# output:\n# Setting up swapspace version 1, size = 130 GiB (139586433024 bytes)\n# no label, UUID=25a565d9-d19c-4913-87a5-f02750ab625d\n\n# enable the SWAP.\nsudo swapon /swapfile\n\n# check if SWAP is created\nsudo swapon --show\n# output:\n# NAME TYPE SIZE USED PRIO\n# /swapfile file 130G 0B -2\n\n# Once everything is set, you must set the SWAP file as permanent, else you will lose the SWAP after reboot. Run this command:\necho \'/swapfile none swap sw 0 0\' | sudo tee -a /etc/fstab\n
Run Code Online (Sandbox Code Playgroud)\n运行进程后,内存将会增长。
\n这是我的:
\n\n祝你好运!
\n\n我有同样的错误。就我而言,这与内存使用过多有关。重置/清理缓存数据后解决,为每个不再使用的变量添加以下代码:
MyVariableName = None
Run Code Online (Sandbox Code Playgroud)
小智 5
这并不总是内存问题。在我的例子中subprocess.Popen
,它抛出了 137 的错误,看起来像 signalKILL,原因绝对不是内存利用率,因为在运行时它几乎没有使用 1% 的内存使用量。经过更多调查后,这似乎是一个权限问题。我只是将脚本移至/home/ubuntu
根目录。
归档时间: |
|
查看次数: |
30015 次 |
最近记录: |