-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Better fix for load_from_checkpoint() not working with absolute path on Windows #2294
Conversation
Hello @airium! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-06-26 22:02:35 UTC |
Codecov Report
@@ Coverage Diff @@
## master #2294 +/- ##
======================================
- Coverage 88% 88% -0%
======================================
Files 70 70
Lines 5501 5500 -1
======================================
- Hits 4834 4833 -1
Misses 667 667 |
This pull request is now in conflict... :( |
@airium I'm getting this error when I run tests on this branch locally: |
No I didn't notice any similar error. Maybe you could paste longer logs? @awaelchli |
Here it is, haven't had the time to look for the cause. |
I think it's something wrong at the networking part, and the |
return torch.load(path_or_url, map_location=map_location) | ||
return torch.hub.load_state_dict_from_url(path_or_url, map_location=map_location) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stylistic nitpick: we don't need to have this else clause. I personally find it more "assuring" in a way without the else clause b/c you can be sure that the return statement will catch everything haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, looks like the problem is on my side only.
LGTM, but we have to look into the windows CI because that guy never fails tests even though they fail locally (e.g. the yaml test) xD
This pull request is now in conflict... :( |
Hi I am a little confused as I see more unrelated commits are now placed on top of my branch before I want to rebase and resolve conflict. What should I do now before the PR is ready to merge? Is that already OK, or I still need to remove the |
This pull request is now in conflict... :( |
Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com>
* no cov * no cov * ReduceOp * group * reduce_op.sum * Update sklearns.py * formatting * horovod * Apply suggestions from code review * horovod * horovod * horovod * horovod * ci * print * ci * timeout * timeout * time * fix * distributed cpu * pipes * time * cpu * spawn * spawn * spawn * tp * separate * os * os * npm * Fix load_from_checkpoint() not working with URL on Windows * Update CHANGELOG * Update CHANGELOG.md Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com> * Apply suggestions from code review * fix * fix meta tags creating empty lines * pyright * node * fix httpserver address * drop tutils.default_trainer_options * imports * Better fix for load_from_checkpoint() not working with absolute path on Windows (#2294) * Fix load_from_checkpoint() not working with URL on Windows * Update CHANGELOG * Update CHANGELOG.md Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com> * drop duplicate Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com> Co-authored-by: airium <airium@outlook.com> Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com> Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com> Co-authored-by: AIRIUM <38249940+airium@users.noreply.github.com>
What does this PR do?
Discussed in #2243, PR #2244 fixed that
load_from_checkpoint()
not working with absolute path on Windows, but introduced a new bug that on WindowsPath(path_or_url).is_file()
will always raise OSError on any valid URL, so blocked:This PR makes a better fix:
Fixes #2243
Fixes #2244
Before submitting
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 🙃