zoogzog / chexnet

Implementation of the CheXNet network (PyTorch)
206 stars 93 forks source link

Unable to extract m-25012018-123527.pth.tar #7

Open Gambitier opened 6 years ago

Gambitier commented 6 years ago

hi, I am trying to extract m-25012018-123527.pth.tar, but while doing so error occurred. I have tried it on both windows and ubuntu.

zoogzog commented 6 years ago

I don't think you are supposed to extract the model file at all. I am not even sure it is a tar archive at all, yet that is how networks are saved in various examples. For example: imagenet (line 267), mnist (line 62).

Here is the documentation about saving/loading networks.

In my code, I can load the saved model to continue training as presented below, where checkpoint is the path to the tar file.

modelCheckpoint = torch.load(checkpoint) model.load_state_dict(modelCheckpoint['state_dict']) optimizer.load_state_dict(modelCheckpoint['optimizer'])

hyattbaker commented 4 years ago

Had the same question thanks @zoogzog