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

why i got same number with Alexnet ? #1169

Open
Dushuai12138 opened this issue Nov 11, 2022 · 1 comment
Open

why i got same number with Alexnet ? #1169

Dushuai12138 opened this issue Nov 11, 2022 · 1 comment

Comments

@Dushuai12138
Copy link

STE
please tell me some possible reason, thanks a lot

@Dushuai12138
Copy link
Author

model_name = 'inceptionresnetv2'  # could be fbresnet152 or inceptionresnetv2
model = pretrainedmodels.__dict__[model_name](num_classes=1001, pretrained=None)
model_to_load = torch.load(root + "model_file/inceptionresnetv2-520b38e4.pth")  # 注意修改
model.load_state_dict(model_to_load, strict=True)
model.last_linear = nn.Linear(1536, 6 * 101)

it is the previous codes, it can run well. but when i replace them with

model_name = 'Alexnet'  # could be fbresnet152 or inceptionresnetv2
model = models.alexnet(pretrained=True)
num_fc = model.classifier[6].in_features
model.classifier[6] = torch.nn.Linear(in_features=num_fc, out_features=606)

i got a result which has the same number

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