You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RichProgressBar swallows the input for pdb or pdbr which makes debugging with those tools virtually impossible.
This is a known issue in rich which does not yet have a solution: See here
With RichProgressBar on the way of replacing tqdm as default it would be good to either document a workaround, or to reconsider that decision.
To Reproduce
Use RichProgressBar in the Trainer callback and put
importpdb; pdb.set_trace()
or
breakpoint()
somewhere inside the training_step(...) or validation_step(...) of your module.
If the execution stops at that breakpoint you will still get the (Pdb) repl, which also works. However the input will not be shown which makes you blind when typing pdb commands.
Note that the input `p "Hello World!" is not shown. It should appear in the repl behind (Pdb)
The same Example with ProgressBar
...
(Pdb) p"Hello World!"'Hello World!'
(Pdb)
Expected behavior
The input to pdb is shown when typed.
Environment
PyTorch Lightning Version (e.g., 1.3.0): 1.5.1
PyTorch Version (e.g., 1.8): 1.10.0+cu113
Python version: 2.8.10
OS (e.g., Linux): Linux
CUDA/cuDNN version: 11.3 / 8.2
GPU models and configuration: Not relevant
How you installed PyTorch (conda, pip, source): pip
If compiling from source, the output of torch.__config__.show():
Any other relevant information:
Additional context
This is not a bug that can/should be fixed in pytorch-lighting. However now that the progress-bar is in PytorchLightning we need this to be pointed out in the documentation.
The text was updated successfully, but these errors were encountered:
keyraphi
changed the title
pdb - based debugging with RichProgressBar is not possible
pdb - based debugging with RichProgressBar doesn't show input
Nov 18, 2021
Hey I just manged to find the time to test this.
I realized that by now the PR was merged to main and the branch was deleted.
The change in fact improved the situation. With the above example we now get:
The progress-bar is still rendered after pdb stopped the main-thread, so the typed input appears behind the bar.
This is much better than before, so thank you!
The prints behind the rich progress bar also can be observed when using rich.Console to print/log something inside the training loop. E.g. with console.print():
🐛 Bug
RichProgressBar swallows the input for pdb or pdbr which makes debugging with those tools virtually impossible.
This is a known issue in rich which does not yet have a solution: See here
With RichProgressBar on the way of replacing tqdm as default it would be good to either document a workaround, or to reconsider that decision.
To Reproduce
Use RichProgressBar in the Trainer callback and put
or
breakpoint()
somewhere inside the
training_step(...)
orvalidation_step(...)
of your module.If the execution stops at that breakpoint you will still get the (Pdb) repl, which also works. However the input will not be shown which makes you blind when typing pdb commands.
For example with the RichProgressBar:
Note that the input `p "Hello World!" is not shown. It should appear in the repl behind (Pdb)
The same Example with ProgressBar
Expected behavior
The input to pdb is shown when typed.
Environment
conda
,pip
, source): piptorch.__config__.show()
:Additional context
This is not a bug that can/should be fixed in pytorch-lighting. However now that the progress-bar is in PytorchLightning we need this to be pointed out in the documentation.
The text was updated successfully, but these errors were encountered: