Python Forum
troubles with tqdm - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: troubles with tqdm (/thread-41201.html)



troubles with tqdm - max22 - Nov-27-2023

I have a problem with tqdm progress bar. I have a code like this my code with wrongly working tqdm
If I have printed the debugging messages I have really got this as the first line of the output:

HERE HERE Epoch: 395, Epochs: 396

But the progress bar stops already at 393 not at 395 as required,see the attachment to this post. This is not the case for all numbers, sometimes the progress bar really
stops at Epochs - 1. E.g., 388/389 [00:09<00:00, 43.03it/s] so, 389 is such a miraculous number where the progress bar from tqdm stops rightly at epochs -1 position. Also, changing the condition on the line 587 at the pastebin.com site above with
if epoch >= epochs : also gives an error. It BTW doesn't give an error if the program has been executed for several times before because
the Jupyter Notebook environment apparently remembers the data from the previous run. I'm saying this only because I was sooo happy that I have resolved the issue with tqdm but in fact I didn't. Where is the bug/problem with my code ?? Many thanks to all readers of this post.


EDIT
I have noticed that what is the miraculous number depends on the number of elements in this array, I think that the issue is some
modulo arithmetic but I'm uncertain with the exact eplanation:
Quote:new_persons_results = [
# [101, 112],
# [0.54422416, 0.02778176],
# [22.57372914, 17.96922325],
# [22.57372914, 17.96922325]
# Add more new persons as needed
# [23.65780072, 18.8599168 ],
# [22.57372914, 17.96922325],
# [32.55342397, 29.46365141],
# [ 6.71803504, 25.70466547],
# [ 6.71803504, 25.70466547],
# [14.40191857, 16.77085649],
# [17.45790731, 21.76521471],
# [2110.02796947, 73.45445955],
# [30.29513837, 62.90111289],
# [15.1289778, 32.40267702],

[23.65780072, 18.8599168 ],
[22.57372914, 17.96922325],
[32.55342397, 29.46365141],
[ 6.71803504, 25.70466547],
[14.40191857, 16.77085649],
[17.45790731, 21.76521471],
[20.02796947, 73.45445955],

]



RE: troubles with tqdm - deanhystad - Nov-27-2023

Write a short example that demonstrates the problem and post the example code, not a link to a private post on pastebin.

Jupyter notebook kind of works like a spreadsheet. You can change the contents of one cell and see how the change affects other cells.


RE: troubles with tqdm - max22 - Nov-27-2023

I have found the bug. It is that tqdm doesn't cooperate with Jupyter so nicely as tqdm_notebook does. Thank you for your help.