-
Notifications
You must be signed in to change notification settings - Fork 380
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
Support capturing interactive progress bar #440
Comments
Also for colored output,
|
tqdm integration seems useful. thanks for reporting! colored output should at least be ignored and not show up in the current format. |
Any updates on this? Would be super-useful to have. |
I managed to fix the TQDM issue with multiple lines, but not the color issue. To fix, use: from sacred import SETTINGS
from sacred.utils import apply_backspaces_and_linefeeds
SETTINGS.CAPTURE_MODE = 'sys'
...
ex.captured_out_filter = apply_backspaces_and_linefeeds From what I understand: If you don't do this, tqdm will detect that you are using a terminal ( Feel free to correct me. This comes from my limited knowledge of linux, shells and streams. |
I also have this problem. Using only
Adding
Ideally I'd like to capture only what I log:
|
@fepegar isn't the output after applying def filter_logs(captured_out):
return "\n".join(line for line in captured_out.split("\n") if line.startswith("INFO"))
ex = Experiment('name')
ex.captured_out_filter = filter_logs |
The problem with the Maybe I can just filter out the lines containing something that looks like a progress bar. def remove_progress(captured_out):
lines = (line for line in captured_out.splitlines() if 'it/s]' not in line)
return '\n'.join(lines)
ex.captured_out_filter = remove_progress |
If you're using Python 3, this issue may be because the captured output has all of its carriage returns ( This quick fix has worked for me: Try altering line 119 in stdout_capturing.py to be |
I am using
tqdm
which interactively update the progress bar in the terminal.A sacred observer captures stdout like this:
Applying
ex.captured_out_filter = apply_backspaces_and_linefeeds
has no effect.If I have a nested tqdm (two for-loops),
The text was updated successfully, but these errors were encountered: