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

Error with torch.hub.load when using num_classes kwarg #6

Open
kchonka opened this issue Nov 10, 2021 · 0 comments
Open

Error with torch.hub.load when using num_classes kwarg #6

kchonka opened this issue Nov 10, 2021 · 0 comments

Comments

@kchonka
Copy link

kchonka commented Nov 10, 2021

When trying to access dpn107 via the PyTorch Hub API, I run into this error:

Error(s) in loading state_dict for DPN: size mismatch for classifier.weight: copying a param with shape torch.Size([1000, 2688, 1, 1]) from checkpoint, the shape in current model is torch.Size([16, 2688, 1, 1]). size mismatch for classifier.bias: copying a param with shape torch.Size([1000]) from checkpoint, the shape in current model is torch.Size([16]).

The call I used was:
torch.hub.load('rwightman/pytorch-dpn-pretrained', 'dpn107', num_classes=16, pretrained=True)

When specifying the num_classes arg, this error appears.

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

1 participant