简体   繁体   English

在没有明确原因的情况下,“杀死”了针对keras LSTM模型的GridSearchCV培训

[英]GridSearchCV training on a keras LSTM model is “killed” without a clear reason

I am stumped by a super strange issue. 我被一个超级奇怪的问题所困扰。 I am trying to train a simple LSTM model with sklearn classifier and GridSearchCV. 我正在尝试使用sklearn分类器和GridSearchCV训练一个简单的LSTM模型。 With gridsearch on multiple jobs, the code would hang without any output; 在多个作业上进行gridsearch时,代码将挂起而没有任何输出。 with a single job, the process would be killed with the above output: 一个工作,该过程将被上述输出终止:

2018-02-17 18:15:02.733824: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
234/234 [==============================] - 0s 1ms/step
935/935 [==============================] - 1s 626us/step
234/234 [==============================] - 0s 2ms/step
935/935 [==============================] - 1s 684us/step
234/234 [==============================] - 1s 2ms/step
935/935 [==============================] - 1s 684us/step
234/234 [==============================] - 1s 2ms/step
935/935 [==============================] - 1s 547us/step
...
...
234/234 [==============================] - 4s 16ms/step
935/935 [==============================] - 1s 1000us/step
Killed

Does anyone know what's killing the GridSearchCV ? 有谁知道杀死GridSearchCV的原因是什么?

Your python process is being killed by the Linux Kernel's OOM killer, as the system is out of memory and python is requesting more. Linux内核的OOM杀手正在杀死您的python进程,因为系统内存不足并且python要求更多。

Since you are doing cross-validation, I assume you are also using TensorFlow as backend, and in that case it is possible that its a bug in Keras/TF as the session isn't cleared. 由于您正在执行交叉验证,因此我假设您还将TensorFlow用作后端,在这种情况下,有可能由于未清除会话而在Keras / TF中存在一个错误。 More information in https://github.com/keras-team/keras/issues/2102 更多信息请参见https://github.com/keras-team/keras/issues/2102

A quick solution would be to use keras.backend.clear_session after each CV iteration. 一个快速的解决方案是在每个CV迭代之后使用keras.backend.clear_session If you are not using the TF backend, then its probably a bug in your own code. 如果您不使用TF后端,则它可能是您自己的代码中的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM