-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
bug: .pth
files generated by PyTorch are incompatible with path configuration file handling
#300
Comments
Hi @qthequartermasterman, thank you for the bug report! I don't think settling on .pth as a convention for the extension was a good idea 🤔 But anyway, here it is. What does the Thanks for the PR, that seems like the most reasonable thing to do. |
Agreed, concerning not being a good idea. Unfortunately, it's the state the PyTorch ecosystem is in. And I think there isn't much movement because the collision is a problem so rarely. I only learned about path configuration files this week while debugging this issue in one of my repos. I personally plan on avoiding using the "pth" extension moving forward. There's been an issue open for many years to standardize on ".pt". I've also wondered what the h stands for, but never found anything definitive. I think it's for PyTorcH. |
I see, thanks for the additional context! |
Description of the bug
According to the official PyTorch saving and loading guide, it is a "common PyTorch convention is to save models using either a .pt or .pth file extension."
This is incompatible with the path configuration files, which also use the
.pth
extension, that have special handling ingriffe
.To Reproduce
Full traceback
Full traceback
Expected behavior
Griffe should ignore PyTorch
.pth
files instead of trying to parse them as site configuration files.Environment information
Note that I could reproduce this issue on any version of python so long as the pytorch
.pth
file was present. As soon as the.pth
file was gone, mkdocs would build properly.Additional context
The text was updated successfully, but these errors were encountered: