-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'debug adapter' error in jupyter notebook #1166
Comments
Here's a copy of my log from VS CODE start to attempted execution of the problematic line of code. I can't tell what is triggering the problem. |
Evidently, the problem is due to the debugger having problems with multiprocessing. I get the "Failed to launch debugger for child process XXX" error once per multiprocessing thread. And, I can make the error disappear by removing multiprocessing (where it is possible to do so). I can debug the line However, most of the later code depends on Pytorch Lightning, specifically the pl.Trainer module, for which multiprocessing cannot be turned off--as far as I can tell. So, I can't run the debugger on this code to better understand it. I did find a suggestion on the web to add |
Note that using just one thread does not prevent the problem, multiprocessing has to be turned off entirely. So, for example, if I set 'num_workers=1' in train_loader, the debugger problem occurs. It only disappears with num_workers removed entirely. As for pl.Trainer, even if I tell it to use one device (thread in case my case), I still get the debugger error. There seems to be no way to turn of multiprocessing for pl.Trainer. It would be tremendously helpful if the debugger would work if multiprocessing were set to just one thread. |
Jupyter debugger doesn't support debugging subprocesses currently; this is tracked at microsoft/vscode-jupyter#9886 |
I'm fuzzy on just what debugging subprocesses entails. Does that involve splitting the debugger to follow each of the subprocesses? If so, check out how Eclipse with Pydev handles the kind of multiprocessing code VS Code can't. It just steps through it as if it were one process. Maybe not ideal if someone needs to debug interacting threads, but more than covers my, and I suspect many people's, use cases. |
debugpy itself supports this; it just needs to be wired on Jupyter side of things. |
That's good to know! Any suggestions on how I could get this to work? |
I can't think of any obvious workaround here given that you don't get access to the debug config to set |
Thanks for letting me know. Out of my wheelhouse. |
@int19h, any chance debug configurations for cell debugging will be made modifiable in the future? |
@matthiasgeihs You could make a feature request to provide configurability on the Jupyter extension (https://github.com/microsoft/vscode-jupyter) |
this worked for me |
zaheeruddinfaiz 's solution no longer works since init.py does not contain _config in it |
It's located in |
Changing |
This worked for me, thanks! |
Try reinstalling your extension. This is a known error. |
Type: Bug
ACTUAL BEHAVIOR
When running debug on a particular cell in the notebook below, the debugging halts and an error message appears.
https://github.com/phlippe/uvadlc_notebooks/blob/master/docs/tutorial_notebooks/tutorial5/Inception_ResNet_DenseNet.ipynb
The cell is the one with the first line: imgs, _ = next(iter(train_loader)).
With a breakpoint on that cell, the debugger stops normally. I then seek to step to the next line and then the debugger greys out VSCode and shows the following error message:
"Couldn't find a debug adapter descriptor for debug type 'Python Kernel Debug Adapter' (extension might have failed to activate)"
This occurs with multiple instances of the message: "I also get a "Failed to launch debugger for child process XXX"
I ran the debugger for multiple cells above this cell and had no problems. I've tried reinstalling and switching to the pre-release versions of both the Python and Jupyter extensions (both Microsoft) and restarting vscode each time. The error occurs in all cases. (BTW, I tried to submit this bug report by using 'Python: Report Issue', but I do not have that option.)
EXPECTED BEHAVIOR:
On debugging the cell, after stepping over the first line of code, the debugger should move to the 2nd line of code with no error message.
Extension version: 2022.20.1
VS Code version: Code 1.74.2 (e8a3071ea4344d9d48ef8a4df2c097372b0c5161, 2022-12-20T10:27:19.253Z)
OS version: Linux x64 5.10.0-20-amd64
Modes:
Sandboxed: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: