Description
In old version caffe.WE can use accuracy layers.
But the latest caffe can't work.
I find this code.
for (int i = 0; i < bottom[1]->num_axes(); ++i) {
CHECK_LE(bottom[0]->shape(i), bottom[1]->shape(i))
<< "Dimension mismatch between predictions and label.";
}
Shall it be
CHECK_GE(bottom[0]->shape(i), bottom[1]->shape(i))
<< "Dimension mismatch between predictions and label.";
However,Ignoring the code
trainning can work.
But the test accuracy is weird.
0.97 at first!!!
I0307 22:39:26.767015 11018 solver.cpp:266] Iteration 0, Testing net (#0)
I0307 22:39:32.170459 11018 solver.cpp:315] Test net output #0: accuracy = 0.972474
I0307 22:39:32.308109 11018 solver.cpp:189] Iteration 0, loss = 3.61126
Below is the error
0307 22:50:42.629432 20621 net.cpp:120] Top shape: 32 36 1 1 (1152)
I0307 22:50:42.629452 20621 layer_factory.hpp:74] Creating layer conv_final_conv_final_0_split
I0307 22:50:42.629464 20621 net.cpp:84] Creating Layer conv_final_conv_final_0_split
I0307 22:50:42.629474 20621 net.cpp:380] conv_final_conv_final_0_split <- conv_final
I0307 22:50:42.629495 20621 net.cpp:338] conv_final_conv_final_0_split -> conv_final_conv_final_0_split_0
I0307 22:50:42.629508 20621 net.cpp:338] conv_final_conv_final_0_split -> conv_final_conv_final_0_split_1
I0307 22:50:42.629521 20621 net.cpp:113] Setting up conv_final_conv_final_0_split
I0307 22:50:42.629541 20621 net.cpp:120] Top shape: 32 36 1 1 (1152)
I0307 22:50:42.629552 20621 net.cpp:120] Top shape: 32 36 1 1 (1152)
I0307 22:50:42.629562 20621 layer_factory.hpp:74] Creating layer loss
I0307 22:50:42.629573 20621 net.cpp:84] Creating Layer loss
I0307 22:50:42.629585 20621 net.cpp:380] loss <- conv_final_conv_final_0_split_0
I0307 22:50:42.629595 20621 net.cpp:380] loss <- label_data_1_split_0
I0307 22:50:42.629607 20621 net.cpp:338] loss -> (automatic)
I0307 22:50:42.629621 20621 net.cpp:113] Setting up loss
I0307 22:50:42.629631 20621 layer_factory.hpp:74] Creating layer loss
I0307 22:50:42.629650 20621 net.cpp:120] Top shape: (1)
I0307 22:50:42.629662 20621 net.cpp:122] with loss weight 1
I0307 22:50:42.629688 20621 layer_factory.hpp:74] Creating layer accuracy
I0307 22:50:42.629708 20621 net.cpp:84] Creating Layer accuracy
I0307 22:50:42.629719 20621 net.cpp:380] accuracy <- conv_final_conv_final_0_split_1
I0307 22:50:42.629729 20621 net.cpp:380] accuracy <- label_data_1_split_1
I0307 22:50:42.629741 20621 net.cpp:338] accuracy -> accuracy
I0307 22:50:42.629755 20621 net.cpp:113] Setting up accuracy
F0307 22:50:42.629791 20621 accuracy_layer.cpp:26] Check failed: bottom[0]->shape(i) <= bottom[1]->shape(i) (36 vs. 1) Dimension mismatch between predictions and label.