I am using PyCaffe to implement a neural network inspired by the VGG 16 layer network. I want to use the pre-trained model available from their GitHub page. Generally this w
The problem is not with 4096 but rather with 25088. You need to calculate the output feature maps for each layer of your network based on the input feature maps. Note that the fc
layer takes an input of fixed size so the output of the previous conv
layer must match the input size required by the fc
layer. Calculate your fc6 input feature map size (this is the output feature map of the previous conv
layer) using the input feature map size of the previous conv
layer. Here's the formula:
H_out = ( H_in + 2 x Padding_Height - Kernel_Height ) / Stride_Height + 1
W_out = (W_in + 2 x Padding_Width - Kernel_Width) / Stride_Width + 1
This error comes up if you're cropping the images to 224, rather than the 227 that was done with the original dataset. Adjust that and you should be good to go.