F0402 21:53:20.098677 35553 data_transformer.cpp:63] Check failed: datum_height == data_mean_.height() (256 vs. 224)
when using ResNet_mean.binaryproto. The input data layer is following:
1 name: "ResNet-50"
2 layer {
3 name: "resnet_50"
4 type: "Data"
5 top: "data"
6 top: "label"
7 include {
8 phase: TRAIN
9 }
10 transform_param {
11 mirror: true
12 crop_size: 224
13 mean_file: "../ResNet_mean.binaryproto"
14 #mean_file: "../imagenet_mean.binaryproto"
15 }
16 data_param {
17 source: "../ilsvrc12_train_lmdb/"
18 batch_size: 16
19 backend: LMDB
20 }
21 }
22 layer {
23 name: "resnet_50"
24 type: "Data"
25 top: "data"
26 top: "label"
27 transform_param {
28 crop_size: 224
29 mean_value: 104
30 mean_value: 117
31 mean_value: 123
32 mirror: true
33 }
34 include {
35 phase: TEST
36 }
37 data_param{
38 source: "../ilsvrc12_val_lmdb/"
39 batch_size:25
40 backend: LMDB
41 }
42 }
However, when I used imagenet_mean.binaryproto, it works well. So I use python to read imagenet_mean.binaryproto and ResNet_mean.binaryproto file, I found:
imagenet_mean.binaryproto: numpyarray data type with data shape (1, 3, 256, 256)
ResNet_mean.binaryproto: (1, 3, 224, 224)
It seems that when using mean binary file, caffe first subtracts mean value from original image and then do the crop. But when I use ResNet_mean.binaryproto, which 3*224*224, not matching input image size 3*256*256.
Does anyone have the same problem and how do you solve this? Thank you so much for your help.
Z.L