Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkpoint Issue #48

Open
Asaad-Pak opened this issue Aug 1, 2024 · 1 comment
Open

Checkpoint Issue #48

Asaad-Pak opened this issue Aug 1, 2024 · 1 comment

Comments

@Asaad-Pak
Copy link

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?

@jolapodolszanska
Copy link

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants