Issue
I am using tqdm
to print progress in a script I'm running in a Jupyter notebook. I am printing all messages to the console via tqdm.write()
. However, this still gives me a skewed output like so:
That is, each time a new line has to be printed, a new progress bar is printed on the next line. This does not happen when I run the script via terminal. How can I solve this?
Solution
Try using tqdm.notebook.tqdm
instead of tqdm
, as outlined here.
This could be as simple as changing your import to:
from tqdm.notebook import tqdm
Good luck!
EDIT: After testing, it seems that tqdm
actually works fine in 'text mode' in Jupyter notebook. It's hard to tell because you haven't provided a minimal example, but it looks like your problem is caused by a print statement in each iteration. The print statement is outputting a number (~0.89) in between each status bar update, which is messing up the output. Try removing the print statement.
Answered By - oscarbranson
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.