I’m not sure, what’s going on, as I’ve just tested your approach and it’s working fine:
model = pretrainedmodels.senet154()
# Use vanilla model
x = torch.randn(1, 3, 224, 224)
output = model(x)

print(model.last_linear)
>Linear(in_features=2048, out_features=1000, bias=True)

# Change last_linear
model.last_linear = nn.Linear(2048, 1383)
output = model(x)
print(output.shape)
> torch.Size([1, 1383])

Could you check your code again for differences?