Skip to content

[Feature/wishlist] Negative update? #432

@cdluminate

Description

@cdluminate

I went through the document and didn't find a way to roll the tdqm progress bar back. Trying to update the progress bar with a negative value just end up with an error.

In [31]: bar.update(-1)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-31-707a754749a6> in <module>()
----> 1 bar.update(-1)

/usr/lib/python3/dist-packages/tqdm/_tqdm.py in update(self, n)
    925 
    926         if n < 0:
--> 927             raise ValueError("n ({0}) cannot be negative".format(n))
    928         self.n += n
    929 

ValueError: n (-1) cannot be negative

Actually I intended to print the machine learning model accuracy (\in [0,1]) with a progress bar library,
and the accuracy value while training is NOT monotonously increasing. Is there any workaround?

Thanks.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions