CheXNet icon indicating copy to clipboard operation
CheXNet copied to clipboard

Checkpoint Issue

Open Asaad-Pak opened this issue 1 year ago • 1 comments

hello @arnoweng I am in urgent need of this CheXNet model. I downloaded "model.pth.tar" file but I am unable to extract files like we normally extract files from a zip folder can you tell me how can I extract the model checkpoint or basic code to checkpoint?

Asaad-Pak avatar Aug 01 '24 18:08 Asaad-Pak

You should extract that with Python code, not manual. I use code from this repo and it working fine.

CKPT_PATH = 'model.pth.tar' ... model = DenseNet121(N_CLASSES).cuda() model = torch.nn.DataParallel(model).cuda()

if os.path.isfile(CKPT_PATH):
    print("=> loading checkpoint")
    checkpoint = torch.load(CKPT_PATH)
    model.load_state_dict(checkpoint['state_dict'], strict=False)
    print("=> loaded checkpoint (Some weights might not be loaded)")
else:
    print("=> no checkpoint found")

jolapodolszanska avatar Mar 18 '25 18:03 jolapodolszanska