Model.pth or model.pt?

Which extension should be used for saving the model:

torch.save(model.state_dict(), os.path.join(model_dir, 'epoch-{}.pth'.format(epoch))) link

or

torch.save(model.state_dict(), os.path.join(model_dir, 'epoch-{}.pt'.format(epoch))) link

1 Like

I don’t think there’s preference of one over the other, it’s just a convention like .pkl or .pck or .pickle, but by convention from python docs, we go with .pkl similarly, we are choosing .pth here. It doesn’t matter.

similar forum_post and SO answer

1 Like