Can't debug in terminal when progress bar is running.
Opened this issue · 3 comments
Describe the bug
I think the progress bar rendering makes it difficult to debug anything. I often use import ipdb; ipdb.set_trace()
before the line I want to debug. Then I call the program using command line like python yolo/lazy.py task=train model=v9-s dataset=mock task.epoch=1
etc.
But, I think the progress bar is getting in the way and the cursor disappears. Can't type anything in the terminal afterward.
Also, if the call to lazy.py fails for some reason, the cursor doesn't appear anymore on that terminal.
I am using WSL. I ran other programs, but this never happened in my other programs.
To Reproduce
Steps to reproduce the behavior:
- In the terminal for your environment do
pip install ipdb
. - In the ModelValidator.solve() call
import ipdb; ipdb.set_trace()
- Go back to terminal.
- See that you can't interact anymore.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
After running the program from the terminal using python yolo/lazy.py task=train model=v9-s dataset=mock task.epoch=1
, the interactive debugging in the terminal no longer works.
System Info (please complete the following ## information):
- OS: [Ubuntu 22.04]
- Python Version: [3.10]
- PyTorch Version: [2.4.0]
- CUDA/cuDNN/MPS Version: []
- YOLO Model Version: [YOLOv9-s]
Additional context
A temporary solution that is working for me is never setting
progress.start()
in lazy.py. I'll test today if this solution keeps working I'll close the issue.
Megvii-BaseDetection/YOLOX#843
this also helped when debugging dataloader.
set cpu_num to zero in genera.yaml
We need to find a way to enable debugging while using this rich
library.
Can't set debug points using ipdb, once a loop is started using track.
Debugging this repo is unnecessarily hard due to this rich
library.