fastai / fastprogress

Simple and flexible progress bar for Jupyter Notebook and console
Apache License 2.0
1.09k stars 106 forks source link

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' #49

Closed imayachita closed 4 years ago

imayachita commented 4 years ago

Hi there, I got an error

File "/home/venv/lib/python3.7/site-packages/fastprogress/fastprogress.py", line 264, in add_child
    self.child.prefix = f'Epoch {self.main_bar.last_v+1}/{self.main_bar.total} :'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

I solved it by commenting that particular line. But, is there any better workaround for this? Because the workaround I did means that I have to change the script in the installation.

Thanks!

Single430 commented 4 years ago
        self.last_v = 0
        if parent is None: self.leave,self.display = leave,display
        else:
            self.leave,self.display=False,False
            parent.add_child(self)
       #  self.last_v,self.comment = None,''
        self.last_v,self.comment = 0,''

This works, the author should have mistakenly written it. @imayachita

sgugger commented 4 years ago

As mentioned in #57, please reopen with a clear reproducer if needed.