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
Force display of iterations per second (it/s) - instead of displaying inverse (s/it) based on rate #1259
Comments
It is not inconsistent, it is clearly dependant of speed of your iteration - which by your image is not the same (your data loader probably had some time to load some batches during validation so in the beggining of training epoch 29 you had higher training rate). but you are affected by the fact that your slower iterations are displayed in seconds per iteration with simmilar number to one that was in iterations per second. with rate unit being fixed to it/s or s/it - you would be able to recognize this more clearly. |
Indeed, this is clearly undesirable in the case your rate hovers around 1, in which case you can get the unit flipping between itself and its inverse quite frequently! |
Ha! Got fooled by this,really nasty imho. |
I also hit this confusion of the tqdm unit (it/s and s/it)
|
So there is no built-in switch for this? This explicit bar format seems like a very verbose way of achieving consistent units. ...nevertheless, thank you for sharing it! |
For a given code example:
the output looks like this:
6%|▌ | 6/100 [00:09<02:21, 1.50s/it]
but I'd like for it to actually force display it/s (generally, units per time, and possibly vice versa) so the output for this example (with the required parameter being set) would look like this:
6%|▌ | 6/100 [00:09<02:21, 0.67it/s]
as I see it, this functionality is basically hardcoded in std.py (in master branch as of October 2021)
tqdm/tqdm/std.py
Line 450 in fc69d5d
a modification of the above code line to
rate_fmt = rate_noinv_fmt
achieves desired behavior, but does not parametrize the rate when each format should be displayed. As I see it right now, that hardcoded "1" may be the only thing in need of parametrizing (possibly member variable) with an option to be set to None or so to completely ignore it, while a default value could be 1 to preserve current default behavior.
is there any other way right now to "force" set it/s mode (without changing tqdm code), and possibly set the "trigger" frequency? Say, for example, one might want to display seconds per iteration only if rate is lower than 1e-3 it/s)...
EDIT 1, 2 & 3: sentence formatting, spelling, punctuation
The text was updated successfully, but these errors were encountered: