Hy! I have loaded Resnet-152 pre-trained model, and modified the out features of the fc layer through following model.
Now i want to apply relu on the modified fc layer, and then add a new fc layer which take out_features of previous fc layer, and out_feature = 10, like this:
Any Help?
You could assign an nn.Sequential container to model.fc instead of a single linear layer via:
nn.Sequential
model.fc
model.fc = nn.Sequential( nn.Linear(num_ftrs, 1024), nn.ReLU(), nn.Linear(1024, 10) )
Thanks Dear @ptrblck ! It worked