tuxdna
tuxdna

Reputation: 8487

Explanation of output of Python tqdm.

I have a program in python that uses tqdm to output progress bar which shows like below:

  0%|          |   1/782 [00:02<31:00,  2.38s/it, loss=0.763 ]
 17%|█▋        | 134/782 [00:19<01:21,  7.98it/s, loss=0.375 ]
100%|██████████| 782/782 [03:50<00:00,  2.73it/s, loss=0.0193]
100%|█████████▉| 779/782 [03:47<00:00,  4.33it/s, loss=0.0175]
100%|█████████▉| 780/782 [03:48<00:00,  4.08it/s, loss=0.0172]
100%|█████████▉| 781/782 [03:48<00:00,  3.83it/s, loss=0.0195]

Lets take 2nd row:

 17%|█▋        | 134/782 [00:19<01:21,  7.98it/s, loss=0.375 ]

The fields in order are:

I understand that it is showing progress and stats like, iterations per second, loss obtained etc. However I am not able to precisely say what this time format ( 00:19<01:21 for example ) represents in every row? What does the < sign indicate?

Upvotes: 52

Views: 24520

Answers (2)

Yonas Kassa
Yonas Kassa

Reputation: 3710

In the source code [1] there is a comment about it in format_meter method, it refers to {elapsed}<{remaining}

[1] https://github.com/tqdm/tqdm/blob/master/tqdm/std.py#L397

Upvotes: 38

The value 00:19 in 00:19<01:21, 7.98it/s is the elapsed time, while the value 1:21 is the remaining time, acording to the iterations per second value. Hence, it is not a static value.

Upvotes: 11

Related Questions