I am trying to use caffe to extract features of the convolution layer rather than FC layer from VGG network.The theoretical input image size may be arbitrary in this situation. But it seams that VGG network was trained on images cropped to the size 224x224 pixel. So I define an input data layer in the deploy.prototext:
layers{
name: "data"
type: MEMORY_DATA
top: "data"
top: "label"
transform_param{
mirror: false
crop_size:224
mean_value:129.1863
mean_value:104.7624
mean_value:93.5940
}
memory_data_param{
batch_size:1
channels:3
width:224
height:224
}
}
I tried to modify the width = 500\height = 500\crop_size = 500 but failed. Caffe throws some errors:“ Cannot copy param 0 weights from layer 'fc6'; shape mismatch. Source param shape is 1 1 4096 25088 (102760448); target param shape is 4096 131072 (536870912). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.”
How is it possible that I can run on images which are too big for the input layer without cropping?