I have a fit function with following for loop inside of it:
for epoch in self.progressbar(range(n_epochs)):
If I use a Jupyter notebook it works fine. However if I rerun the cell, it just throws me an error:
File ~/.local/share/virtualenvs/ML_Zero_To_Hero-tWttz9GG/lib/python3.11/site-packages/progressbar/progressbar.py:154, in ProgressBar.__next__(self)
152 self.start()
153 else:
--> 154 self.update(self.currval + 1)
155 return value
156 except StopIteration:
File ~/.local/share/virtualenvs/ML_Zero_To_Hero-tWttz9GG/lib/python3.11/site-packages/progressbar/progressbar.py:250, in ProgressBar.update(self, value)
246 if value is not None and value is not widgets.UnknownLength:
247 if (self.maxval is not widgets.UnknownLength
248 and not 0 <= value <= self.maxval):
--> 250 raise ValueError('Value out of range')
252 self.currval = value
255 if not self._need_update(): return
ValueError: Value out of range
Do I have to somehow reset the progress bar?
I am instantiating the progress bar as: progressbar.ProgressBar(widgets=bar_widgets)
where bar_widgets = [ 'Training: ', progressbar.Percentage(), ' ', progressbar.Bar(marker='-', left='[', right=']'), ' ', progressbar.ETA() ]
I was expecting the progress bar to reset automatically