I’m computing the Frechet Inception Distance(FID) with Inception-v3 Network.
And I try to replace the Fully Connected layer with Identity layer to extract the features.
Before implementing the replacement inception_model.fc = torch.nn.Identity()
, check the model summary and get the output shape of last two layers as below:
- InceptionE-293 [-1, 2048, 8, 8]
- Linear-294 [-1, 1000]
After implementing the replacement, check and get the output shape of last two layers as below:
- InceptionE-293 [-1, 2048, 8, 8]
- Identity-294 [-1, 2048]
The confusion is:
why the output shape of Identity layer is [-1, 2048], and not the same as its input, which is [-1, 2048, 8, 8] ?
Thanks~