Can't remotely debug with pycharm anymore
Debugging remotely through ssh with pycharm used to work fine, but after the latest update it no longer works. after hitting a breakpoint, the variables window shows "collecting data" forever, trying to inspect any variable by typing its name in the console results in things hanging for awhile and finally printing a blank line, and continuing execution via f8 or f10 just freezes everything. I tried to switch to suspect everything instead of suspend thread in breakpoint options, and when i do this and then try to inspect variables in the console i get the following error:
Traceback (most recent call last):
File "/private/home/abaevski/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_comm.py", line 1647, in do_it
result = pydevd_console_integration.console_exec(self.thread_id, self.frame_id, self.expression, dbg)
File "/private/home/abaevski/.pycharm_helpers/pydev/_pydevd_bundle/pydevd_console_integration.py", line 188, in console_exec
updated_globals.update(frame.f_globals)
AttributeError: 'NoneType' object has no attribute 'f_globals'
attempting to continue execution still freezes everything.
Note that I can debug simple programs, but anything more complex (with GPU utilization, multiple processes, etc) leads to this behavior. I am not sure what exactly is the difference is
Any ideas?
Please sign in to leave a comment.
ok, i have found the issue. i was running pytorch code with num_workers in dataset > 0 (which spawns a child process to load data) and this caused pycharm debugging to not work
I see similar behaviour also. The remote debugger intermittently hangs at a breakpoint when debugging with multiple workers in pytorch dataloader, but is more stable with only a main thread. Local debugging works fine for either case. Crazy, as it is, when I press 'stop' to halt debugging in multi-threaded runs after it hang, it resumes briefly printing messages to the console as if it continued through the code, but then dies. Pycharm Pro 2019.3. Pytorch 1.3, Python 3.7.3 .
Please submit an issue to https://youtrack.jetbrains.com/issues with project example and steps to reproduce.
I am suffering from the same issue.
After updating pycharm to the latest version (2020.1 pro edition, Build #PY-201.6668.115) yesterday, debugger hangs at breakpoint.
Doesn't show any variables, hanging at "collecting data".
Stepping over to next line doesn't work either.
Using num_worker=0 helps evading the issue, but I hope for an urgent fix for this issue.
The following log pops up repeatedly, same number of time as the number of workers.
Expected: /home/sanghoon/.pycharm_helpers/pydev/pydevd_attach_to_process/attach_linux_amd64.so to exist.
I've seen others suggest deleting ~/.pycharm_helpers folder in the remote machine, but that doesn't fix the issue for me.
I am using mac for my local machine, paired with remote ubuntu machine with CUDA 10.1.
same set-up, same problem here
If you get the same error as in the comment above, please follow this bug in our issue tracker https://youtrack.jetbrains.com/issue/PY-41359