Skip to content

Commit 02f0ad0

Browse files
committed
Show last update when progressbar is done.
This way, it is easier to see how many samples really got processed. It still shows 100% when done; I'd prefer it to read 'Done' but didn't find out how to do it without much complexity added.
1 parent 01927be commit 02f0ad0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ def start(self):
2626
def update(self, i):
2727
_sys.stdout.write("\r" + self.fmt.format(i=i, tot=self.tot, pct=float(i)/self.tot))
2828
_sys.stdout.flush()
29+
self.lasti = i
2930

3031
def finish(self):
31-
_sys.stdout.write("\r" + self.fmt.format(i=self.tot, tot=self.tot, pct=1.0) + "\n")
32+
_sys.stdout.write("\r" + self.fmt.format(i=self.lasti, tot=self.tot, pct=1.0) + "\n")
3233
_sys.stdout.flush()
3334

3435
def make_progressbar(mode, epoch, data_size):

0 commit comments

Comments
 (0)