-
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
Model.load_from_checkpoint tries to open file path as URL and fail #2243
Comments
Hi! thanks for your contribution!, great first issue! |
Ah I didn’t think about Windows when I implemented this. I’ll take a look if there’s a better way. |
We could try to detect if the file exists with if os.path.isfile() or Path(path_of_chkpt).is_file() instead of checking for scheme |
Also came across this when I was running tests on windows. I wonder why it was not showing up in CI. |
The only reason I see is that tmpdir is a relative path without prefix at the start, dodging the problem. It should be fixed by my PR, I hope. |
Thanks @Molaire. I can verify the tests now pass locally on windows. |
I am afraid the PR #2244 introduced a new bug, as now on Windows |
🐛 Bug
load_from_checkpoint tries to classify if the input is a file path or an URL and detects the hard drive letter as a scheme and then classify wrongly the input because of this.
urllib.error.URLError: <urlopen error unknown url type: d>
My input:
D:\Prog\Projects\AceriNet\research_seed\checkpoints\acerinet\bnacerinet0_target=OVA_OK_penalized=None_loss_fn=ce_normalized=True_balanced=FalseFalse_seed=42_val_loss=0.374_val_auroc=0.9041_v0.ckpt
To Reproduce
Steps to reproduce the behavior:
Use any path with a hard drive letter at the start (windows formatting) for pl.LightningModule().load_from_checkpoint(path)
The text was updated successfully, but these errors were encountered: