Did you get the error just by changing the file extension? I.e. is my code snippet also failing, if you use .pkl?
pickle files are serialized Python objects, but I’m unsure if PyTorch checks the file extension or not.