Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 49 #57

Closed
wants to merge 4 commits into from
Closed

Fix issue 49 #57

wants to merge 4 commits into from

Conversation

srikarplus
Copy link

The following error has been addressed in this patch

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'

Looks like self.last_v has been wrongly initialized to None.

Addressed the issue #49

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

@sgugger
Copy link
Contributor

sgugger commented Mar 28, 2020

Thanks for your PR.

No, this is not a mistake, this has the meaning that on_iter_begin should be called if iterating through the progress bar again, as is addressed here.

Issue #49 does not contain a reproducer and was filed before the code was widely refactored. If there is still a bug like this, I would need a reproducer. This fix will actually break the main behavior.

@srikarplus
Copy link
Author

Ohh my bad!!! I thought since the variable self.last_v was already initialized to 0 here, again initializing to None was not required. Thanks for taking some time to explain @sgugger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants