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

None check for filepath in ModelCheckpoint #1654

Merged
merged 2 commits into from
Apr 29, 2020
Merged

None check for filepath in ModelCheckpoint #1654

merged 2 commits into from
Apr 29, 2020

Conversation

yukw777
Copy link
Contributor

@yukw777 yukw777 commented Apr 28, 2020

Check if the optional filepath is None before checking if it exists

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • N/A Did you make sure to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Fixes #1535. #1535 (comment)

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Apr 28, 2020

Hello @yukw777! Thanks for updating this PR.

Line 89:111: E501 line too long (113 > 110 characters)

Comment last updated at 2020-04-29 16:08:12 UTC

@mergify mergify bot requested a review from a team April 28, 2020 23:22
Check if the optional filepath is None before checking if it exists
@yukw777
Copy link
Contributor Author

yukw777 commented Apr 28, 2020

Line 89:111: E501 line too long (113 > 110 characters)

I'm assuming this is OK? I thought the line length limit was 120.

@codecov
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #1654 into master will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #1654   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files          71      71           
  Lines        4175    4175           
======================================
+ Hits         3691    3692    +1     
+ Misses        484     483    -1     

@Borda
Copy link
Member

Borda commented Apr 29, 2020

Line 89:111: E501 line too long (113 > 110 characters)

I'm assuming this is OK? I thought the line length limit was 120.

we set kind or warning limit 110 which is applied via pep8speaks and 120 as a hard limit in tests (flake8)

@Borda Borda added the bug Something isn't working label Apr 29, 2020
@Borda Borda added this to the 0.7.6 milestone Apr 29, 2020
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🦝

@Borda Borda added the ready PRs ready to be merged label Apr 29, 2020
@Borda Borda requested a review from a team April 29, 2020 11:41
@tullie
Copy link
Contributor

tullie commented Apr 29, 2020

Do you think it's worth having a log for this case? E.g. "Model checkpoint isn't saved because file path not provided".

I think it's almost worth making this a warning log, it's pretty frustrating if you train a model and then realize after a few days of training that the models weren't checkpointing.

@yukw777
Copy link
Contributor Author

yukw777 commented Apr 29, 2020

@tullie checkpoints are still saved if filepath is None. It just means that the user wants PL to dynamically figure out the path, which is inside the log folder under checkpoints.

@mergify mergify bot requested a review from a team April 29, 2020 13:53
@Borda Borda removed the ready PRs ready to be merged label Apr 29, 2020
Copy link
Contributor

@tullie tullie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yukw777 makes sense! Thanks

@mergify
Copy link
Contributor

mergify bot commented Apr 29, 2020

Great job! =)

@mergify mergify bot merged commit 42d5cfc into Lightning-AI:master Apr 29, 2020
@mergify
Copy link
Contributor

mergify bot commented Apr 29, 2020

Great job! =)

@yukw777 yukw777 deleted the bugfix/1535_filepath-none-check branch April 29, 2020 17:18
Copy link
Contributor

@olineumann olineumann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

Wouldn't it be better to check save_top_k != 0 instead of save_top_k > 0 because also when save_top_k == -1 checkpoints could be overwritten.

See:
olineumann@1e0844a

@Borda @awaelchli
Because it is already merged, I can create a PR if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow keeping default save_dir in ModelCheckpointer
6 participants