It seems to work! Now, I would like to remove the avgpool, so I defined an Identity module and replaced it with that. However, now I don’t know what input size to define the subsequent linear layer with. Before, I could just do fc.in_features.
Is there a way to get the output shape of layer4[2].conv3?