I not an expert but I think the first linear layer takes input from the last pooling layer. Now, I’ve hand calculated the output of last pooling layer and it is coming out as 512 * 7 * 7. Size of each feature map is 7 * 7 and 512 such feature maps.
Input to first layer is : 224 * 224 * 3
Maybe I’m wrong, but this is my calculation:
Output dimension of each layer:
Conv L1: 224 * 224 * 64
Conv L2: 224 * 224 * 64
Pool L1: 112 * 112 * 64
Conv L3: 112 * 112 * 128
Conv L4: 112 * 112 * 128
Pool L2: 56 * 56 * 128
Conv L5: 56 * 56 * 256
Conv L6: 56 * 56 * 256
Conv L7: 56 * 56 * 256
Pool L3: 28 * 28 * 256
Conv L8: 28 * 28 * 512
Conv L9: 28 * 28 * 512
Conv L10: 28 * 28 * 512
Pool L4: 14 * 14 * 512
Conv L11: 14 * 14 * 512
Conv L12: 14 * 14 * 512
Conv L13: 14 * 14 * 512
Pool L5: 7 * 7 * 512
Output of Conv Layer: (I + 2*P - K)/S + 1 ; I: input width(assuming height = width), P: padding, K: Kernel size, S: Stride.
Output of Pooling Layer: (I - M)/S + 1; I: input width, M: Pooling Kernel size; S: Stride.
Please let me know where am I wrong. And how should I decide the input for the first Linear Layer. Thank You.