Model saving as a zip file

Hi, I am trying to run this repo on my custom dataset: GitHub - Lotayou/everybody_dance_now_pytorch: A PyTorch Implementation of "Everybody Dance Now" from Berkeley AI lab.

the repo requires pytorch’s 0.4.1.post2 version but I’m running on latest pytorch version 1.7+ on google colab
In models/spynet.py file they have used serialization of pytorch which is removed so I used GitHub - bshillingford/python-torchfile: Deserialize Lua torch-serialized objects from Python for that. except for that, code is almost same as the repository.

When I run training, everything goes fine and weights are saved in checkpoint folder (created during training)
but the very strange thing is, the saved weights, latest_net_G.pth is actually a zip file(without zip extension) and on extracting it, I get this structure
Archive

  • Data Folder consisting of hundreds of pth files
  • some data.pkl file of weight 3KB

Now thats totally strange, I have also checked models/base_models.py file and the model is saved normally there

I’m confused, kindly help, Thanks.

PyTorch (but I’d recommend to use the .pt extension) uses a zip-based format since PyToch 1.6, see Deprecated old torch.save serialization format in the 1.6 release notes.

Best regards

Thomas

so should I simply load that zip file and use it? I’m sorry I’m a bit new and have confusion.
thanks

Yeah, torch.load will do the right thing (or torch.jit.load if it’s a scripted model).

thank you for the help.