VS code showing Error: Session cannot generate requests after every use of catboost with gpu

1.9k Views Asked by At

I have been trying to use my Nvidia Geforce GTX 1650 GPU for training catboost regressor. It worked well but after finish training, it kills the kernel and needs to restart the vs code

Here is the code:-

import pandas as pd
import numpy as np

df = pd.read_csv('train.csv')
test = pd.read_csv('test.csv')

from catboost import CatBoostRegressor

cat = CatBoostRegressor(iterations=2000,learning_rate=0.061582,task_type='GPU')
cat.fit(df.drop('loss',axis = 1),df.loss)

This run fine but every time I try to run the next cell it shows this error:

Error: Session cannot generate requests
Error: Session cannot generate requests
at w.executeCodeCell (c:\Users\singh\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:327199)
at w.execute (c:\Users\singh\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:326520)
at w.start (c:\Users\singh\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:322336)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async t.CellExecutionQueue.executeQueuedCells (c:\Users\singh\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:336863)
at async t.CellExecutionQueue.start (c:\Users\singh\.vscode\extensions\ms-toolsai.jupyter-2021.8.1236758218\out\client\extension.js:90:336403)

I have updated all my packages using pip-review, updated jupyter extension, and xgboost with tree_method = 'gpu_hist' is working fine.

Operating System - Windows

Cuda version - 11.2

Nvidia Driver - 462

2

There are 2 best solutions below

0
On

I had the same issue, I restarted the kernel and VS code and it seems to have fixed the issue.

0
On

In my experience, in only means that somewhere in my code there is an 'infinite loop'. The way I solved this was to restart VS Code and checked my code for said "infinite loop" before I rerun it again. I hope this helped...