Can someone help me understand the difference between the .pkl and the .pth files? I was looking at the repo for Render deployment and saw that one of the files has the message, “Download export.pkl in the current dir”, but when I open that file it instead says, “The .pth files should get downloaded here.”
I know the .pkl file has my full serialized model. So what’s the .pth file?
pkl stands for a “pickle” file which is a way of serializing objects in Python. Its contents can be almost anything; it just depends on what was serialized.
The pth file is your model’s weights (and optimizer state if saved with_opt).
Ah, great! So is there an advantage to using the pth file instead of the pkl file for my model deployment? For example, the pth file is more lightweight?