Adv. PyTorch: Modifying the Last Layer | Ramin's Homepage
raminnabati.com › 2020 › 06Jun 21, 2020 · As expected, the output dimension for the last layer is 1000. Let’s assume we are going to use this model on the COCO dataset with 80 object categories. To change the output dimension of the model to 80, we simply replace the last sub-layer with a new Linear layer. The Linear layer takes two required arguments: in_features and out_features.