Is there an easy way to access the last layer in a torchvision model, without coding a special version for each type of model as described in this tutorial: Finetuning Torchvision Models — PyTorch Tutorials 1.2.0 documentation
Ie. the problem is that the last layer has different names for different pretrained models, like “fc” for ResNet, “classifier” for DenseNet etc. I tried to access the layer like accessing an OrderedDict (d.items()…) but didn’t succeed.