I’m afraid not. maybe try:
if hasattr(model,'fc'):
    model.fc = nn.Linear(model.fc.in_features,out_size)
elif hasattr(model,'classifier'):
    model.classifier = nn.Linear(model.classifier.in_features,out_size)
else:
	raise Exception('unknown classifier module-name')

But I can’t guarantee it.