vscode-jupyter: Kernel crashed when using RandomForestRegression module from sklearn.ensemble

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!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (3 by maintainers)

Most upvoted comments

@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?

Same issue when using the transformers library from HuggingFace

Has anybody found a solution to this?

same here. Anybody?