小编Ern*_*une的帖子

任何 n_jobs 进行交叉验证的内存泄漏

我正在运行一个代码来进行二进制分类并在之后预测标签。该代码与一个大小为 257673 行和 47 列的特定数据库完美运行。当我尝试使用 91690 行和 10 列之一(当然更小)时,我收到错误调用:

TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker. The exit codes of the workers are {SIGKILL(-9)} 
Run Code Online (Sandbox Code Playgroud)

我正在使用一条cross validation线n_job=-1

cross_val_score(model, X.drop(target,axis=1), X[target], cv=outer_cv, n_jobs=-1, scoring='neg_mean_squared_error')

outer_cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=1)
Run Code Online (Sandbox Code Playgroud)

model 是 sklearn 算法中的任何一种,我已经尝试过 AdaBoostClassifier、LogisticRegression、KNN、SVM、GradientBoosting、RandomForest、DecisionTreeClassifier……以及许多其他算法,但我一直遇到同样的错误。

我已尝试更改n_jobs=-2, 1, 2,但错误仍然存​​在。我在 …

python memory-management scikit-learn jupyter-notebook

5
推荐指数
1
解决办法
917
查看次数