{"action":"closed","issue":{"url":"https://api.github.com/repos/BVLC/caffe/issues/2063","labels_url":"https://api.github.com/repos/BVLC/caffe/issues/2063/labels{/name}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/2063/comments","events_url":"https://api.github.com/repos/BVLC/caffe/issues/2063/events","html_url":"https://github.com/BVLC/caffe/issues/2063","id":60209314,"number":2063,"title":"How to use the new accuracy","user":{"login":"BestSonny","id":6027713,"avatar_url":"https://avatars.githubusercontent.com/u/6027713?v=3","gravatar_id":"","url":"https://api.github.com/users/BestSonny","html_url":"https://github.com/BestSonny","followers_url":"https://api.github.com/users/BestSonny/followers","following_url":"https://api.github.com/users/BestSonny/following{/other_user}","gists_url":"https://api.github.com/users/BestSonny/gists{/gist_id}","starred_url":"https://api.github.com/users/BestSonny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BestSonny/subscriptions","organizations_url":"https://api.github.com/users/BestSonny/orgs","repos_url":"https://api.github.com/users/BestSonny/repos","events_url":"https://api.github.com/users/BestSonny/events{/privacy}","received_events_url":"https://api.github.com/users/BestSonny/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-07T14:54:51Z","updated_at":"2015-03-09T19:45:18Z","closed_at":"2015-03-09T19:45:18Z","body":"In old version caffe.WE can use accuracy layers.\r\nBut the latest caffe can't work.\r\nI find this code.\r\n\r\n  for (int i = 0; i < bottom[1]->num_axes(); ++i) {\r\n    CHECK_LE(bottom[0]->shape(i), bottom[1]->shape(i))\r\n        << \"Dimension mismatch between predictions and label.\";\r\n  }\r\n\r\nShall it be\r\n\r\nCHECK_GE(bottom[0]->shape(i), bottom[1]->shape(i))\r\n        << \"Dimension mismatch between predictions and label.\";\r\n\r\n\r\nHowever,Ignoring the code\r\ntrainning can work.\r\nBut the test accuracy is weird.\r\n0.97 at first!!!\r\n\r\n I0307 22:39:26.767015 11018 solver.cpp:266] Iteration 0, Testing net (#0)\r\nI0307 22:39:32.170459 11018 solver.cpp:315]     Test net output #0: accuracy = 0.972474\r\nI0307 22:39:32.308109 11018 solver.cpp:189] Iteration 0, loss = 3.61126\r\n\r\n\r\n\r\nBelow is the error\r\n\r\n\r\n0307 22:50:42.629432 20621 net.cpp:120] Top shape: 32 36 1 1 (1152)\r\nI0307 22:50:42.629452 20621 layer_factory.hpp:74] Creating layer conv_final_conv_final_0_split\r\nI0307 22:50:42.629464 20621 net.cpp:84] Creating Layer conv_final_conv_final_0_split\r\nI0307 22:50:42.629474 20621 net.cpp:380] conv_final_conv_final_0_split <- conv_final\r\nI0307 22:50:42.629495 20621 net.cpp:338] conv_final_conv_final_0_split -> conv_final_conv_final_0_split_0\r\nI0307 22:50:42.629508 20621 net.cpp:338] conv_final_conv_final_0_split -> conv_final_conv_final_0_split_1\r\nI0307 22:50:42.629521 20621 net.cpp:113] Setting up conv_final_conv_final_0_split\r\nI0307 22:50:42.629541 20621 net.cpp:120] Top shape: 32 36 1 1 (1152)\r\nI0307 22:50:42.629552 20621 net.cpp:120] Top shape: 32 36 1 1 (1152)\r\nI0307 22:50:42.629562 20621 layer_factory.hpp:74] Creating layer loss\r\nI0307 22:50:42.629573 20621 net.cpp:84] Creating Layer loss\r\nI0307 22:50:42.629585 20621 net.cpp:380] loss <- conv_final_conv_final_0_split_0\r\nI0307 22:50:42.629595 20621 net.cpp:380] loss <- label_data_1_split_0\r\nI0307 22:50:42.629607 20621 net.cpp:338] loss -> (automatic)\r\nI0307 22:50:42.629621 20621 net.cpp:113] Setting up loss\r\nI0307 22:50:42.629631 20621 layer_factory.hpp:74] Creating layer loss\r\nI0307 22:50:42.629650 20621 net.cpp:120] Top shape: (1)\r\nI0307 22:50:42.629662 20621 net.cpp:122]     with loss weight 1\r\nI0307 22:50:42.629688 20621 layer_factory.hpp:74] Creating layer accuracy\r\nI0307 22:50:42.629708 20621 net.cpp:84] Creating Layer accuracy\r\nI0307 22:50:42.629719 20621 net.cpp:380] accuracy <- conv_final_conv_final_0_split_1\r\nI0307 22:50:42.629729 20621 net.cpp:380] accuracy <- label_data_1_split_1\r\nI0307 22:50:42.629741 20621 net.cpp:338] accuracy -> accuracy\r\nI0307 22:50:42.629755 20621 net.cpp:113] Setting up accuracy\r\nF0307 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.\r\n"}}