Kernel crashed when using RandomForestRegression module from sklearn.ensemble

See original GitHub issue

Code

  • X_train.shape = (1118287, 176)
  • y_train.shape = (1118287, 1)
bagging_fraction = 0.3
n_estimators = 10

forest = RandomForestRegressor(n_jobs=-1, max_features='sqrt',
                random_state=0, max_samples=bagging_fraction, max_depth=7,
                verbose=0,n_estimators=n_estimators)
forest.fit(X_train.values, y_train.values)

Crash report

Canceled future for execute_request message before replies were done The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.

Jupyter Log

error 9:44:22.642: Disposing session as kernel process died ExitCode: 3221225725, Reason: Unable to load extension: pydevd_plugins.extensions.types.pydevd_plugin_pandas_types
xxxxxxx_mypath\temp\lib\site-packages\traitlets\traitlets.py:2389: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
xxxxxxx_mypath\temp\lib\site-packages\traitlets\traitlets.py:2343: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use '72a003ed-29e6-4f50-8c7f-d98eca049a73' instead of 'b"72a003ed-29e6-4f50-8c7f-d98eca049a73"'.
  warn(

info 9:44:22.643: Dispose Kernel process
info 9:44:22.643: kill daemon
error 9:44:22.643: Raw kernel process exited code: 3221225725
error 9:44:22.645: Error in waiting for cell to complete [Error: Canceled future for execute_request message before replies were done
	at t.KernelShellFutureHandler.dispose (c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:1322339)
	at c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:1341391
	at Map.forEach (<anonymous>)
	at v._clearKernelState (c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:1341376)
	at v.dispose (c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:1334858)
	at c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:537744
	at t.swallowExceptions (c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:920640)
	at u.dispose (c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:537722)
	at t.RawSession.dispose (c:\Users\win10\.vscode\extensions\ms-toolsai.jupyter-2022.4.1021342353\out\extension.node.js:2:541401)
	at runMicrotasks (<anonymous>)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)]
warn 9:44:22.645: Cell completed with errors {
  message: 'Canceled future for execute_request message before replies were done'
}
info 9:44:22.646: Cancel all remaining cells true || Error || undefined
info 9:44:22.646: Cancel pending cells
info 9:44:22.646: Cell 26 executed with state Error

Question

I have tried the model on partial data, i.e. the first 100 rows of data, and there is no bug in jupyter-notebook. It seems to be the depreciation of dependency on traitlets. But I have tried to downgrade it, like version==4.7, but the bug still exists. Future downgrade of traitlets makes the jupyter-notebook stop at opening. So is there any way to fix that? Thanks in advance!

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
hrmellocommented, Jun 6, 2022

Same issue when using the transformers library from HuggingFace

5reactions
adamplcommented, Jun 1, 2022

@Hoyuri I’m getting the same error on PyCharm: Unable to load extension: pydevd_plugins.extensions.types.pydevd_plugin_pandas_types What should I do to avoid it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

RandomForestClassifier crashes on training - Stack Overflow
I am using scikit.learn RandomForestClassifier to generate a binary classifier, whenever I try fitting the model instance with training ...
Read more >
sklearn.ensemble.RandomForestRegressor
A random forest is a meta estimator that fits a number of classifying decision trees on various sub-samples of the dataset and uses...
Read more >
the kernel crashed while executing code in the the current cell ...
when I use jupyter notebook extension in VS code this error shows up. ... crashed when using RandomForestRegression module from sklearn.ensemble#10057.
Read more >
Multi-Core Machine Learning in Python With Scikit-Learn
A popular example is the ensemble of decision trees, such as bagged decision trees, random forest, and gradient boosting. In this section we ......
Read more >
Using Random Forests in Python with Scikit-Learn
We'll be using the venerable iris dataset for classification and the Boston housing set for regression. Sklearn comes with a nice selection of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found