caffe学习--cifar10学习-ubuntu16.04-gtx650tiboost--1g--02

 

训练网络:

caffe train  -solver  examples/cifar10/cifar10_quick_solver.prototxt 


I1025 09:52:16.952167  7453 sgd_solver.cpp:105] Iteration 3700, lr = 0.001
I1025 09:52:18.843194  7453 solver.cpp:218] Iteration 3800 (52.8951 iter/s, 1.89054s/100 iters), loss = 0.593796
I1025 09:52:18.843243  7453 solver.cpp:237]     Train net output #0: loss = 0.593796 (* 1 = 0.593796 loss)
I1025 09:52:18.843261  7453 sgd_solver.cpp:105] Iteration 3800, lr = 0.001
I1025 09:52:20.776065  7453 solver.cpp:218] Iteration 3900 (51.7515 iter/s, 1.93231s/100 iters), loss = 0.713602
I1025 09:52:20.776106  7453 solver.cpp:237]     Train net output #0: loss = 0.713602 (* 1 = 0.713602 loss)
I1025 09:52:20.776114  7453 sgd_solver.cpp:105] Iteration 3900, lr = 0.001
I1025 09:52:22.677291  7458 data_layer.cpp:73] Restarting data prefetching from start.
I1025 09:52:22.749538  7453 solver.cpp:447] Snapshotting to binary proto file examples/cifar10/cifar10_quick_iter_4000.caffemodel
I1025 09:52:22.766818  7453 sgd_solver.cpp:273] Snapshotting solver state to binary proto file examples/cifar10/cifar10_quick_iter_4000.solverstate
I1025 09:52:22.775292  7453 solver.cpp:310] Iteration 4000, loss = 0.643869
I1025 09:52:22.775322  7453 solver.cpp:330] Iteration 4000, Testing net (#0)
I1025 09:52:23.483098  7460 data_layer.cpp:73] Restarting data prefetching from start.
I1025 09:52:23.508436  7453 solver.cpp:397]     Test net output #0: accuracy = 0.7157
I1025 09:52:23.508478  7453 solver.cpp:397]     Test net output #1: loss = 0.847997 (* 1 = 0.847997 loss)
I1025 09:52:23.508484  7453 solver.cpp:315] Optimization Done.
I1025 09:52:23.508487  7453 caffe.cpp:259] Optimization Done.

 测试时间的:

caffe time -model examples/mnist/lenet_train_test.prototxt -iterations 10

I1025 10:19:02.415710 8451 caffe.cpp:352] Use CPU.
I1025 10:19:02.623905 8451 net.cpp:294] The NetState phase (0) differed from the phase (1) specified by a rule in layer mnist
I1025 10:19:02.623939 8451 net.cpp:294] The NetState phase (0) differed from the phase (1) specified by a rule in layer accuracy
I1025 10:19:02.624037 8451 net.cpp:51] Initializing net from parameters:
name: "LeNet"
state {
phase: TRAIN
level: 0
stage: ""
}

... ...  ...  ...
I1025
10:19:02.848223 8451 net.cpp:198] ip1 needs backward computation. I1025 10:19:02.848227 8451 net.cpp:198] pool2 needs backward computation. I1025 10:19:02.848230 8451 net.cpp:198] conv2 needs backward computation. I1025 10:19:02.848234 8451 net.cpp:198] pool1 needs backward computation. I1025 10:19:02.848237 8451 net.cpp:198] conv1 needs backward computation. I1025 10:19:02.848242 8451 net.cpp:200] mnist does not need backward computation. I1025 10:19:02.848245 8451 net.cpp:242] This network produces output loss I1025 10:19:02.848253 8451 net.cpp:255] Network initialization done. I1025 10:19:02.848287 8451 caffe.cpp:360] Performing Forward I1025 10:19:02.879693 8451 caffe.cpp:365] Initial loss: 2.29607 I1025 10:19:02.879722 8451 caffe.cpp:366] Performing Backward I1025 10:19:02.923279 8451 caffe.cpp:374] *** Benchmark begins *** I1025 10:19:02.923300 8451 caffe.cpp:375] Testing for 10 iterations. I1025 10:19:02.994730 8451 caffe.cpp:403] Iteration: 1 forward-backward time: 71 ms. I1025 10:19:03.067307 8451 caffe.cpp:403] Iteration: 2 forward-backward time: 72 ms. I1025 10:19:03.139232 8451 caffe.cpp:403] Iteration: 3 forward-backward time: 71 ms. I1025 10:19:03.211033 8451 caffe.cpp:403] Iteration: 4 forward-backward time: 71 ms. I1025 10:19:03.283150 8451 caffe.cpp:403] Iteration: 5 forward-backward time: 72 ms. I1025 10:19:03.355051 8451 caffe.cpp:403] Iteration: 6 forward-backward time: 71 ms. I1025 10:19:03.430778 8451 caffe.cpp:403] Iteration: 7 forward-backward time: 75 ms. I1025 10:19:03.503176 8451 caffe.cpp:403] Iteration: 8 forward-backward time: 72 ms. I1025 10:19:03.575840 8451 caffe.cpp:403] Iteration: 9 forward-backward time: 72 ms. I1025 10:19:03.649318 8451 caffe.cpp:403] Iteration: 10 forward-backward time: 73 ms. I1025 10:19:03.649350 8451 caffe.cpp:406] Average time per layer: I1025 10:19:03.649353 8451 caffe.cpp:409] mnist forward: 0.0106 ms. I1025 10:19:03.649368 8451 caffe.cpp:412] mnist backward: 0.001 ms. I1025 10:19:03.649374 8451 caffe.cpp:409] conv1 forward: 7.967 ms. I1025 10:19:03.649387 8451 caffe.cpp:412] conv1 backward: 7.9797 ms. I1025 10:19:03.649391 8451 caffe.cpp:409] pool1 forward: 3.8953 ms. I1025 10:19:03.649394 8451 caffe.cpp:412] pool1 backward: 0.7797 ms. I1025 10:19:03.649397 8451 caffe.cpp:409] conv2 forward: 13.4244 ms. I1025 10:19:03.649401 8451 caffe.cpp:412] conv2 backward: 26.7948 ms. I1025 10:19:03.649405 8451 caffe.cpp:409] pool2 forward: 2.1919 ms. I1025 10:19:03.649410 8451 caffe.cpp:412] pool2 backward: 0.9304 ms. I1025 10:19:03.649412 8451 caffe.cpp:409] ip1 forward: 2.756 ms. I1025 10:19:03.649415 8451 caffe.cpp:412] ip1 backward: 5.2499 ms. I1025 10:19:03.649420 8451 caffe.cpp:409] relu1 forward: 0.0344 ms. I1025 10:19:03.649422 8451 caffe.cpp:412] relu1 backward: 0.0428 ms. I1025 10:19:03.649426 8451 caffe.cpp:409] ip2 forward: 0.1709 ms. I1025 10:19:03.649430 8451 caffe.cpp:412] ip2 backward: 0.2136 ms. I1025 10:19:03.649432 8451 caffe.cpp:409] loss forward: 0.0642 ms. I1025 10:19:03.649435 8451 caffe.cpp:412] loss backward: 0.0026 ms. I1025 10:19:03.649441 8451 caffe.cpp:417] Average Forward pass: 30.5448 ms. I1025 10:19:03.649446 8451 caffe.cpp:419] Average Backward pass: 42.0169 ms. I1025 10:19:03.649448 8451 caffe.cpp:421] Average Forward-Backward: 72.6 ms. I1025 10:19:03.649452 8451 caffe.cpp:423] Total Time: 726 ms. I1025 10:19:03.649456 8451 caffe.cpp:424] *** Benchmark ends ***

 

caffe time -model examples/mnist/lenet_train_test.prototxt -gpu 0

I1025 10:20:00.676383 8487 caffe.cpp:348] Use GPU with device ID 0
I1025 10:20:00.889961 8487 net.cpp:294] The NetState phase (0) differed from the phase (1) specified by a rule in layer mnist
I1025 10:20:00.889991 8487 net.cpp:294] The NetState phase (0) differed from the phase (1) specified by a rule in layer accuracy
I1025 10:20:00.890086 8487 net.cpp:51] Initializing net from parameters:
name: "LeNet"
state {
phase: TRAIN
level: 0
stage: ""
}

... ...  ...  ... 
I1025
10:20:01.122086 8487 caffe.cpp:360] Performing Forward I1025 10:20:01.124756 8487 caffe.cpp:365] Initial loss: 2.34191 I1025 10:20:01.124771 8487 caffe.cpp:366] Performing Backward I1025 10:20:01.125615 8487 caffe.cpp:374] *** Benchmark begins *** I1025 10:20:01.125625 8487 caffe.cpp:375] Testing for 50 iterations. I1025 10:20:01.138612 8487 caffe.cpp:403] Iteration: 1 forward-backward time: 8.47408 ms. I1025 10:20:01.146049 8487 caffe.cpp:403] Iteration: 2 forward-backward time: 7.38394 ms. I1025 10:20:01.155109 8487 caffe.cpp:403] Iteration: 3 forward-backward time: 9.0225 ms. I1025 10:20:01.161478 8487 caffe.cpp:403] Iteration: 4 forward-backward time: 6.32 ms. I1025 10:20:01.170373 8487 caffe.cpp:403] Iteration: 5 forward-backward time: 8.86355 ms. I1025 10:20:01.177851 8487 caffe.cpp:403] Iteration: 6 forward-backward time: 7.41622 ms. I1025 10:20:01.187093 8487 caffe.cpp:403] Iteration: 7 forward-backward time: 9.20099 ms. I1025 10:20:01.193529 8487 caffe.cpp:403] Iteration: 8 forward-backward time: 6.38976 ms. I1025 10:20:01.200045 8487 caffe.cpp:403] Iteration: 9 forward-backward time: 6.47888 ms. I1025 10:20:01.210321 8487 caffe.cpp:403] Iteration: 10 forward-backward time: 10.2353 ms. I1025 10:20:01.217547 8487 caffe.cpp:403] Iteration: 11 forward-backward time: 7.18 ms. I1025 10:20:01.225344 8487 caffe.cpp:403] Iteration: 12 forward-backward time: 7.73363 ms. I1025 10:20:01.232453 8487 caffe.cpp:403] Iteration: 13 forward-backward time: 7.06461 ms. I1025 10:20:01.240022 8487 caffe.cpp:403] Iteration: 14 forward-backward time: 7.532 ms. I1025 10:20:01.249349 8487 caffe.cpp:403] Iteration: 15 forward-backward time: 9.27904 ms. I1025 10:20:01.249379 8487 blocking_queue.cpp:49] Waiting for data I1025 10:20:01.268914 8487 caffe.cpp:403] Iteration: 16 forward-backward time: 19.5232 ms. I1025 10:20:01.279377 8487 caffe.cpp:403] Iteration: 17 forward-backward time: 10.4125 ms. I1025 10:20:01.286734 8487 caffe.cpp:403] Iteration: 18 forward-backward time: 7.30182 ms. I1025 10:20:01.294451 8487 caffe.cpp:403] Iteration: 19 forward-backward time: 7.67226 ms. I1025 10:20:01.302402 8487 caffe.cpp:403] Iteration: 20 forward-backward time: 7.89741 ms. I1025 10:20:01.310400 8487 caffe.cpp:403] Iteration: 21 forward-backward time: 7.96928 ms. I1025 10:20:01.317606 8487 caffe.cpp:403] Iteration: 22 forward-backward time: 7.16723 ms. I1025 10:20:01.323557 8487 caffe.cpp:403] Iteration: 23 forward-backward time: 5.92131 ms. I1025 10:20:01.330713 8487 caffe.cpp:403] Iteration: 24 forward-backward time: 7.10467 ms. I1025 10:20:01.336655 8487 caffe.cpp:403] Iteration: 25 forward-backward time: 5.90749 ms. I1025 10:20:01.345613 8487 caffe.cpp:403] Iteration: 26 forward-backward time: 8.92973 ms. I1025 10:20:01.351608 8487 caffe.cpp:403] Iteration: 27 forward-backward time: 5.95821 ms. I1025 10:20:01.357544 8487 caffe.cpp:403] Iteration: 28 forward-backward time: 5.90122 ms. I1025 10:20:01.366344 8487 caffe.cpp:403] Iteration: 29 forward-backward time: 8.72832 ms. I1025 10:20:01.372421 8487 caffe.cpp:403] Iteration: 30 forward-backward time: 6.03226 ms. I1025 10:20:01.382807 8487 caffe.cpp:403] Iteration: 31 forward-backward time: 10.3558 ms. I1025 10:20:01.388767 8487 caffe.cpp:403] Iteration: 32 forward-backward time: 5.92176 ms. I1025 10:20:01.397477 8487 caffe.cpp:403] Iteration: 33 forward-backward time: 8.67101 ms. I1025 10:20:01.403537 8487 caffe.cpp:403] Iteration: 34 forward-backward time: 6.00432 ms. I1025 10:20:01.412868 8487 caffe.cpp:403] Iteration: 35 forward-backward time: 9.30355 ms. I1025 10:20:01.419735 8487 caffe.cpp:403] Iteration: 36 forward-backward time: 6.81789 ms. I1025 10:20:01.426568 8487 caffe.cpp:403] Iteration: 37 forward-backward time: 6.79034 ms. I1025 10:20:01.434139 8487 caffe.cpp:403] Iteration: 38 forward-backward time: 7.51936 ms. I1025 10:20:01.441957 8487 caffe.cpp:403] Iteration: 39 forward-backward time: 7.77027 ms. I1025 10:20:01.449676 8487 caffe.cpp:403] Iteration: 40 forward-backward time: 7.67699 ms. I1025 10:20:01.455268 8487 caffe.cpp:403] Iteration: 41 forward-backward time: 5.55248 ms. I1025 10:20:01.463119 8487 caffe.cpp:403] Iteration: 42 forward-backward time: 7.81456 ms. I1025 10:20:01.469161 8487 caffe.cpp:403] Iteration: 43 forward-backward time: 6.00304 ms. I1025 10:20:01.477457 8487 caffe.cpp:403] Iteration: 44 forward-backward time: 8.24778 ms. I1025 10:20:01.483078 8487 caffe.cpp:403] Iteration: 45 forward-backward time: 5.57971 ms. I1025 10:20:01.489542 8487 caffe.cpp:403] Iteration: 46 forward-backward time: 6.42477 ms. I1025 10:20:01.497421 8487 caffe.cpp:403] Iteration: 47 forward-backward time: 7.19514 ms. I1025 10:20:01.503559 8487 caffe.cpp:403] Iteration: 48 forward-backward time: 6.0952 ms. I1025 10:20:01.512117 8487 caffe.cpp:403] Iteration: 49 forward-backward time: 8.49587 ms. I1025 10:20:01.517725 8487 caffe.cpp:403] Iteration: 50 forward-backward time: 5.55443 ms. I1025 10:20:01.517742 8487 caffe.cpp:406] Average time per layer: I1025 10:20:01.517746 8487 caffe.cpp:409] mnist forward: 0.251048 ms. I1025 10:20:01.517750 8487 caffe.cpp:412] mnist backward: 0.00134592 ms. I1025 10:20:01.517755 8487 caffe.cpp:409] conv1 forward: 0.49879 ms. I1025 10:20:01.517771 8487 caffe.cpp:412] conv1 backward: 0.647739 ms. I1025 10:20:01.517773 8487 caffe.cpp:409] pool1 forward: 0.165693 ms. I1025 10:20:01.517779 8487 caffe.cpp:412] pool1 backward: 0.648113 ms. I1025 10:20:01.517783 8487 caffe.cpp:409] conv2 forward: 0.398481 ms. I1025 10:20:01.517786 8487 caffe.cpp:412] conv2 backward: 3.08044 ms. I1025 10:20:01.517791 8487 caffe.cpp:409] pool2 forward: 0.0440877 ms. I1025 10:20:01.517794 8487 caffe.cpp:412] pool2 backward: 0.206023 ms. I1025 10:20:01.517797 8487 caffe.cpp:409] ip1 forward: 0.338913 ms. I1025 10:20:01.517801 8487 caffe.cpp:412] ip1 backward: 0.285026 ms. I1025 10:20:01.517804 8487 caffe.cpp:409] relu1 forward: 0.0160883 ms. I1025 10:20:01.517808 8487 caffe.cpp:412] relu1 backward: 0.0158157 ms. I1025 10:20:01.517812 8487 caffe.cpp:409] ip2 forward: 0.0488646 ms. I1025 10:20:01.517817 8487 caffe.cpp:412] ip2 backward: 0.0671059 ms. I1025 10:20:01.517820 8487 caffe.cpp:409] loss forward: 0.12852 ms. I1025 10:20:01.517824 8487 caffe.cpp:412] loss backward: 0.0384621 ms. I1025 10:20:01.517832 8487 caffe.cpp:417] Average Forward pass: 2.17016 ms. I1025 10:20:01.517837 8487 caffe.cpp:419] Average Backward pass: 5.51324 ms. I1025 10:20:01.517843 8487 caffe.cpp:421] Average Forward-Backward: 7.75216 ms. I1025 10:20:01.517848 8487 caffe.cpp:423] Total Time: 387.608 ms. I1025 10:20:01.517853 8487 caffe.cpp:424] *** Benchmark ends ***

 

caffe time -model examples/mnist/lenet_train_test.prototxt -weights examples/mnist/lenet_iter_4000.caffemodel -gpu 0 -iterations 10


I1025 10:22:48.857121  8553 net.cpp:380] loss -> loss
I1025 10:22:48.857132  8553 layer_factory.hpp:77] Creating layer loss
I1025 10:22:48.857488  8553 net.cpp:122] Setting up loss
I1025 10:22:48.857498  8553 net.cpp:129] Top shape: (1)
I1025 10:22:48.857511  8553 net.cpp:132]     with loss weight 1
I1025 10:22:48.857544  8553 net.cpp:137] Memory required for data: 5169924
I1025 10:22:48.857556  8553 net.cpp:198] loss needs backward computation.
I1025 10:22:48.857563  8553 net.cpp:198] ip2 needs backward computation.
I1025 10:22:48.857575  8553 net.cpp:198] relu1 needs backward computation.
I1025 10:22:48.857578  8553 net.cpp:198] ip1 needs backward computation.
I1025 10:22:48.857583  8553 net.cpp:198] pool2 needs backward computation.
I1025 10:22:48.857594  8553 net.cpp:198] conv2 needs backward computation.
I1025 10:22:48.857599  8553 net.cpp:198] pool1 needs backward computation.
I1025 10:22:48.857601  8553 net.cpp:198] conv1 needs backward computation.
I1025 10:22:48.857616  8553 net.cpp:200] mnist does not need backward computation.
I1025 10:22:48.857620  8553 net.cpp:242] This network produces output loss
I1025 10:22:48.857626  8553 net.cpp:255] Network initialization done.
I1025 10:22:48.857663  8553 caffe.cpp:360] Performing Forward
I1025 10:22:48.860333  8553 caffe.cpp:365] Initial loss: 2.31537
I1025 10:22:48.860348  8553 caffe.cpp:366] Performing Backward
I1025 10:22:48.861186  8553 caffe.cpp:374] *** Benchmark begins ***
I1025 10:22:48.861196  8553 caffe.cpp:375] Testing for 10 iterations.
I1025 10:22:48.874462  8553 caffe.cpp:403] Iteration: 1 forward-backward time: 8.88995 ms.
I1025 10:22:48.885459  8553 caffe.cpp:403] Iteration: 2 forward-backward time: 10.9423 ms.
I1025 10:22:48.894951  8553 caffe.cpp:403] Iteration: 3 forward-backward time: 9.44522 ms.
I1025 10:22:48.902019  8553 caffe.cpp:403] Iteration: 4 forward-backward time: 7.01862 ms.
I1025 10:22:48.910653  8553 caffe.cpp:403] Iteration: 5 forward-backward time: 8.59363 ms.
I1025 10:22:48.922940  8553 caffe.cpp:403] Iteration: 6 forward-backward time: 12.2141 ms.
I1025 10:22:48.930162  8553 caffe.cpp:403] Iteration: 7 forward-backward time: 7.18058 ms.
I1025 10:22:48.938832  8553 caffe.cpp:403] Iteration: 8 forward-backward time: 8.6343 ms.
I1025 10:22:48.945971  8553 caffe.cpp:403] Iteration: 9 forward-backward time: 7.09872 ms.
I1025 10:22:48.958122  8553 caffe.cpp:403] Iteration: 10 forward-backward time: 12.1039 ms.
I1025 10:22:48.958153  8553 caffe.cpp:406] Average time per layer: 
I1025 10:22:48.958156  8553 caffe.cpp:409]      mnist    forward: 0.0056096 ms.
I1025 10:22:48.958160  8553 caffe.cpp:412]      mnist    backward: 0.001536 ms.
I1025 10:22:48.958164  8553 caffe.cpp:409]      conv1    forward: 0.498285 ms.
I1025 10:22:48.958168  8553 caffe.cpp:412]      conv1    backward: 0.676925 ms.
I1025 10:22:48.958173  8553 caffe.cpp:409]      pool1    forward: 0.162208 ms.
I1025 10:22:48.958176  8553 caffe.cpp:412]      pool1    backward: 0.686502 ms.
I1025 10:22:48.958179  8553 caffe.cpp:409]      conv2    forward: 0.418938 ms.
I1025 10:22:48.958184  8553 caffe.cpp:412]      conv2    backward: 3.10982 ms.
I1025 10:22:48.958186  8553 caffe.cpp:409]      pool2    forward: 0.0446272 ms.
I1025 10:22:48.958190  8553 caffe.cpp:412]      pool2    backward: 0.185696 ms.
I1025 10:22:48.958194  8553 caffe.cpp:409]        ip1    forward: 0.295738 ms.
I1025 10:22:48.958199  8553 caffe.cpp:412]        ip1    backward: 0.285965 ms.
I1025 10:22:48.958204  8553 caffe.cpp:409]      relu1    forward: 0.0179744 ms.
I1025 10:22:48.958210  8553 caffe.cpp:412]      relu1    backward: 0.018272 ms.
I1025 10:22:48.958216  8553 caffe.cpp:409]        ip2    forward: 0.0504448 ms.
I1025 10:22:48.958221  8553 caffe.cpp:412]        ip2    backward: 0.0691424 ms.
I1025 10:22:48.958226  8553 caffe.cpp:409]       loss    forward: 0.118474 ms.
I1025 10:22:48.958232  8553 caffe.cpp:412]       loss    backward: 0.0267104 ms.
I1025 10:22:48.958245  8553 caffe.cpp:417] Average Forward pass: 1.88931 ms.
I1025 10:22:48.958252  8553 caffe.cpp:419] Average Backward pass: 7.30781 ms.
I1025 10:22:48.958264  8553 caffe.cpp:421] Average Forward-Backward: 9.26613 ms.
I1025 10:22:48.958271  8553 caffe.cpp:423] Total Time: 92.6613 ms.I1025 10:22:48.958274  8553 caffe.cpp:424] *** Benchmark ends ***

分类:

分类的函数classification 带有五个参数:  分别是部署文件,权重文件,平均数值转换文件,标签文件,目标图像文件。

其中,标签文件的行数应当等同于分类输出的维数,否则会报维度不匹配的错误(我经历过,所以知道--尽管这是一个很小的问题,但是程序就是这么死板,多一个空行就报错)。

classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt ./examples/images/cat.jpg
ples/images/cat.jpgamples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt ./exam 
---------- Prediction for ./examples/images/cat.jpg ----------
0.3778 - "6 dog"
0.3362 - "5 deer"
0.2370 - "4 cat"
0.0264 - "8 horse"
0.0117 - "3 bird"

这里要注意,不是用解决方案配置--solver.prototxt , 也不是用训练测试配置文件--test.prototxt, 而是用部署配置文件 deploy.txt  。 就是类似于cifar10_quick.prototxt   , cifar10_full.prototxt, 以及 lenet.portotxt 这些配置文件。

否则会报错:   Check failed: net_->num_inputs() == 1 (0 vs. 1) Network should have exactly one input.

 

 

多个图像分类:

classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/1.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/2.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/3.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/4.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/5.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/6.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/7.jpg
classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/8.jpg



sea@sea-X550JK:~/caffe$ 
sea@sea-X550JK:~/caffe$ 
sea@sea-X550JK:~/caffe$ 
sea@sea-X550JK:~/caffe$ 
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/1.jpg
---------- Prediction for /home/sea/Downloads/images/cat/1.jpg ----------
0.3888 - "4 cat"
0.2216 - "9 ship"
0.1906 - "1 airplane"
0.0695 - "6 dog"
0.0500 - "5 deer"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/2.jpg
---------- Prediction for /home/sea/Downloads/images/cat/2.jpg ----------
0.9202 - "1 airplane"
0.0613 - "3 bird"
0.0078 - "4 cat"
0.0053 - "10 truck"
0.0018 - "2 automobile"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/3.jpg
---------- Prediction for /home/sea/Downloads/images/cat/3.jpg ----------
0.6837 - "9 ship"
0.0984 - "7 frog"
0.0889 - "10 truck"
0.0602 - "5 deer"
0.0439 - "4 cat"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/4.jpg
---------- Prediction for /home/sea/Downloads/images/cat/4.jpg ----------
0.8204 - "8 horse"
0.0572 - "4 cat"
0.0358 - "1 airplane"
0.0277 - "9 ship"
0.0265 - "6 dog"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/5.jpg
---------- Prediction for /home/sea/Downloads/images/cat/5.jpg ----------
0.9156 - "1 airplane"
0.0441 - "10 truck"
0.0159 - "2 automobile"
0.0107 - "9 ship"
0.0078 - "3 bird"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/6.jpg
---------- Prediction for /home/sea/Downloads/images/cat/6.jpg ----------
0.5397 - "4 cat"
0.4239 - "6 dog"
0.0123 - "5 deer"
0.0117 - "8 horse"
0.0077 - "7 frog"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/7.jpg
---------- Prediction for /home/sea/Downloads/images/cat/7.jpg ----------
0.7133 - "10 truck"
0.0891 - "8 horse"
0.0848 - "2 automobile"
0.0702 - "1 airplane"
0.0314 - "9 ship"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_quick.prototxt ./examples/cifar10/cifar10_quick_iter_4000.caffemodel ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/8.jpg
---------- Prediction for /home/sea/Downloads/images/cat/8.jpg ----------
0.3767 - "5 deer"
0.3018 - "4 cat"
0.1462 - "10 truck"
0.1394 - "6 dog"
0.0260 - "7 frog"

 

快速模型和权重./examples/cifar10/cifar10_quick_iter_4000.caffemodel的调研:

1. 从上面看到8张图错误6张,正确2张。  正确率25%。   这是泛化能力。
2. 自身的测试:
训练集合的精确比率为0.7142,
损失为0.865448
caffe  test  -model  ./examples/cifar10/cifar10_quick_train_test.prototxt  -weights ./examples/cifar10/cifar10_quick_iter_4000.caffemodel -gpu 0 

I1025 11:36:51.564245 10790 caffe.cpp:313] Batch 44, loss = 0.914596
I1025 11:36:51.570861 10790 caffe.cpp:313] Batch 45, accuracy = 0.69
I1025 11:36:51.570873 10790 caffe.cpp:313] Batch 45, loss = 0.803738
I1025 11:36:51.578325 10790 caffe.cpp:313] Batch 46, accuracy = 0.7
I1025 11:36:51.578337 10790 caffe.cpp:313] Batch 46, loss = 0.829137
I1025 11:36:51.585026 10790 caffe.cpp:313] Batch 47, accuracy = 0.69
I1025 11:36:51.585041 10790 caffe.cpp:313] Batch 47, loss = 0.865979
I1025 11:36:51.594761 10790 caffe.cpp:313] Batch 48, accuracy = 0.74
I1025 11:36:51.594782 10790 caffe.cpp:313] Batch 48, loss = 0.708391
I1025 11:36:51.603091 10790 caffe.cpp:313] Batch 49, accuracy = 0.7
I1025 11:36:51.603111 10790 caffe.cpp:313] Batch 49, loss = 0.946827
I1025 11:36:51.603126 10790 caffe.cpp:318] Loss: 0.865448
I1025 11:36:51.603137 10790 caffe.cpp:330] accuracy = 0.7142
I1025 11:36:51.603157 10790 caffe.cpp:330] loss = 0.865448 (* 1 = 0.865448 loss)

   3.  时间测试:

前后向的时间为23毫秒。

总时间长度为1.1秒。

caffe   time     -model  ./examples/cifar10/cifar10_quick_train_test.prototxt  -weights ./examples/cifar10/cifar10_quick_iter_4000.caffemodel -gpu 0 

I1025 11:38:16.669402 10825 caffe.cpp:403] Iteration: 45 forward-backward time: 19.4118 ms.
I1025 11:38:16.694664 10825 caffe.cpp:403] Iteration: 46 forward-backward time: 25.2144 ms.
I1025 11:38:16.713924 10825 caffe.cpp:403] Iteration: 47 forward-backward time: 19.2045 ms.
I1025 11:38:16.738245 10825 caffe.cpp:403] Iteration: 48 forward-backward time: 24.2684 ms.
I1025 11:38:16.763664 10825 caffe.cpp:403] Iteration: 49 forward-backward time: 25.3646 ms.
I1025 11:38:16.782811 10825 caffe.cpp:403] Iteration: 50 forward-backward time: 19.09 ms.
I1025 11:38:16.782827 10825 caffe.cpp:406] Average time per layer: 
I1025 11:38:16.782841 10825 caffe.cpp:409]      cifar    forward: 0.00857536 ms.
I1025 11:38:16.782846 10825 caffe.cpp:412]      cifar    backward: 0.00139584 ms.
I1025 11:38:16.782860 10825 caffe.cpp:409]      conv1    forward: 2.14007 ms.
I1025 11:38:16.782865 10825 caffe.cpp:412]      conv1    backward: 2.03241 ms.
I1025 11:38:16.782867 10825 caffe.cpp:409]      pool1    forward: 0.93871 ms.
I1025 11:38:16.782871 10825 caffe.cpp:412]      pool1    backward: 3.76713 ms.
I1025 11:38:16.782874 10825 caffe.cpp:409]      relu1    forward: 0.248064 ms.
I1025 11:38:16.782878 10825 caffe.cpp:412]      relu1    backward: 0.376273 ms.
I1025 11:38:16.782882 10825 caffe.cpp:409]      conv2    forward: 2.1273 ms.
I1025 11:38:16.782886 10825 caffe.cpp:412]      conv2    backward: 4.11786 ms.
I1025 11:38:16.782889 10825 caffe.cpp:409]      relu2    forward: 0.218598 ms.
I1025 11:38:16.782892 10825 caffe.cpp:412]      relu2    backward: 0.385136 ms.
I1025 11:38:16.782937 10825 caffe.cpp:409]      pool2    forward: 0.221261 ms.
I1025 11:38:16.782939 10825 caffe.cpp:412]      pool2    backward: 0.534493 ms.
I1025 11:38:16.782943 10825 caffe.cpp:409]      conv3    forward: 0.877706 ms.
I1025 11:38:16.782955 10825 caffe.cpp:412]      conv3    backward: 1.8379 ms.
I1025 11:38:16.782958 10825 caffe.cpp:409]      relu3    forward: 0.0326285 ms.
I1025 11:38:16.782961 10825 caffe.cpp:412]      relu3    backward: 0.132778 ms.
I1025 11:38:16.782975 10825 caffe.cpp:409]      pool3    forward: 0.0975443 ms.
I1025 11:38:16.782979 10825 caffe.cpp:412]      pool3    backward: 0.281843 ms.
I1025 11:38:16.782982 10825 caffe.cpp:409]        ip1    forward: 0.0641299 ms.
I1025 11:38:16.782986 10825 caffe.cpp:412]        ip1    backward: 0.100058 ms.
I1025 11:38:16.782990 10825 caffe.cpp:409]        ip2    forward: 0.0288877 ms.
I1025 11:38:16.782994 10825 caffe.cpp:412]        ip2    backward: 0.0482771 ms.
I1025 11:38:16.782996 10825 caffe.cpp:409]       loss    forward: 0.121826 ms.
I1025 11:38:16.783000 10825 caffe.cpp:412]       loss    backward: 0.0234682 ms.
I1025 11:38:16.783010 10825 caffe.cpp:417] Average Forward pass: 8.29833 ms.
I1025 11:38:16.783015 10825 caffe.cpp:419] Average Backward pass: 14.7445 ms.
I1025 11:38:16.783021 10825 caffe.cpp:421] Average Forward-Backward: 23.1076 ms.
I1025 11:38:16.783026 10825 caffe.cpp:423] Total Time: 1155.38 ms.
I1025 11:38:16.783030 10825 caffe.cpp:424] *** Benchmark ends ***

 

权重cifar10_full_iter_70000.caffemodel.h5调研:

1. 自身测试:

caffe  test  -model  ./examples/cifar10/cifar10_full_train_test.prototxt  -weights ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5  -gpu 0 

sea@sea-X550JK:~/caffe$ caffe  test  -model  ./examples/cifar10/cifar10_full_train_test.prototxt  -weights ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5  -gpu 0 
I1025 14:23:51.542804 18169 caffe.cpp:275] Use GPU with device ID 0
I1025 14:23:51.546751 18169 caffe.cpp:279] GPU device name: GeForce GTX 850M
I1025 14:23:51.713084 18169 net.cpp:294] The NetState phase (1) differed from the phase (0) specified by a rule in layer cifar
I1025 14:23:51.713248 18169 net.cpp:51] Initializing net from parameters: 
name: "CIFAR10_full"
state {
  phase: TEST
  level: 0
  stage: ""
}
...  ...  ...  ...  ...
I1025 14:23:52.634953 18169 caffe.cpp:313] Batch 39, accuracy = 0.85
I1025 14:23:52.634968 18169 caffe.cpp:313] Batch 39, loss = 0.455226
I1025 14:23:52.650311 18169 caffe.cpp:313] Batch 40, accuracy = 0.82
I1025 14:23:52.650331 18169 caffe.cpp:313] Batch 40, loss = 0.516594
I1025 14:23:52.666031 18169 caffe.cpp:313] Batch 41, accuracy = 0.86
I1025 14:23:52.666046 18169 caffe.cpp:313] Batch 41, loss = 0.559571
I1025 14:23:52.680202 18169 caffe.cpp:313] Batch 42, accuracy = 0.87
I1025 14:23:52.680218 18169 caffe.cpp:313] Batch 42, loss = 0.312487
I1025 14:23:52.696849 18169 caffe.cpp:313] Batch 43, accuracy = 0.8
I1025 14:23:52.696868 18169 caffe.cpp:313] Batch 43, loss = 0.579208
I1025 14:23:52.711607 18169 caffe.cpp:313] Batch 44, accuracy = 0.85
I1025 14:23:52.711624 18169 caffe.cpp:313] Batch 44, loss = 0.489596
I1025 14:23:52.729244 18169 caffe.cpp:313] Batch 45, accuracy = 0.73
I1025 14:23:52.729265 18169 caffe.cpp:313] Batch 45, loss = 0.698871
I1025 14:23:52.744884 18169 caffe.cpp:313] Batch 46, accuracy = 0.8
I1025 14:23:52.744913 18169 caffe.cpp:313] Batch 46, loss = 0.586852
I1025 14:23:52.764186 18169 caffe.cpp:313] Batch 47, accuracy = 0.79
I1025 14:23:52.764214 18169 caffe.cpp:313] Batch 47, loss = 0.564458
I1025 14:23:52.778921 18169 caffe.cpp:313] Batch 48, accuracy = 0.87
I1025 14:23:52.778936 18169 caffe.cpp:313] Batch 48, loss = 0.434929
I1025 14:23:52.795367 18169 caffe.cpp:313] Batch 49, accuracy = 0.79
I1025 14:23:52.795387 18169 caffe.cpp:313] Batch 49, loss = 0.606755
I1025 14:23:52.795390 18169 caffe.cpp:318] Loss: 0.534957
I1025 14:23:52.795420 18169 caffe.cpp:330] accuracy = 0.8154
I1025 14:23:52.795433 18169 caffe.cpp:330] loss = 0.534957 (* 1 = 0.534957 loss)

2. 自身时间测试:

caffe  time    -model  ./examples/cifar10/cifar10_full_train_test.prototxt  -weights ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5  -gpu 0 


I1025 14:25:22.766800 18229 caffe.cpp:403] Iteration: 29 forward-backward time: 64.5375 ms.
I1025 14:25:22.829309 18229 caffe.cpp:403] Iteration: 30 forward-backward time: 62.4488 ms.
I1025 14:25:22.896539 18229 caffe.cpp:403] Iteration: 31 forward-backward time: 67.1617 ms.
I1025 14:25:22.962805 18229 caffe.cpp:403] Iteration: 32 forward-backward time: 66.2025 ms.
I1025 14:25:23.026084 18229 caffe.cpp:403] Iteration: 33 forward-backward time: 63.2123 ms.
I1025 14:25:23.092511 18229 caffe.cpp:403] Iteration: 34 forward-backward time: 66.3596 ms.
I1025 14:25:23.162700 18229 caffe.cpp:403] Iteration: 35 forward-backward time: 70.1179 ms.
I1025 14:25:23.227666 18229 caffe.cpp:403] Iteration: 36 forward-backward time: 64.8958 ms.
I1025 14:25:23.291137 18229 caffe.cpp:403] Iteration: 37 forward-backward time: 63.4053 ms.
I1025 14:25:23.359288 18229 caffe.cpp:403] Iteration: 38 forward-backward time: 68.0804 ms.
I1025 14:25:23.425307 18229 caffe.cpp:403] Iteration: 39 forward-backward time: 65.949 ms.
I1025 14:25:23.489913 18229 caffe.cpp:403] Iteration: 40 forward-backward time: 64.5361 ms.
I1025 14:25:23.558320 18229 caffe.cpp:403] Iteration: 41 forward-backward time: 68.3355 ms.
I1025 14:25:23.622004 18229 caffe.cpp:403] Iteration: 42 forward-backward time: 63.6237 ms.
I1025 14:25:23.688843 18229 caffe.cpp:403] Iteration: 43 forward-backward time: 66.7711 ms.
I1025 14:25:23.759383 18229 caffe.cpp:403] Iteration: 44 forward-backward time: 70.4762 ms.
I1025 14:25:23.826133 18229 caffe.cpp:403] Iteration: 45 forward-backward time: 66.6718 ms.
I1025 14:25:23.889969 18229 caffe.cpp:403] Iteration: 46 forward-backward time: 63.77 ms.
I1025 14:25:23.957020 18229 caffe.cpp:403] Iteration: 47 forward-backward time: 66.9768 ms.
I1025 14:25:24.020988 18229 caffe.cpp:403] Iteration: 48 forward-backward time: 63.8991 ms.
I1025 14:25:24.082286 18229 caffe.cpp:403] Iteration: 49 forward-backward time: 61.23 ms.
I1025 14:25:24.150640 18229 caffe.cpp:403] Iteration: 50 forward-backward time: 68.2817 ms.
I1025 14:25:24.150679 18229 caffe.cpp:406] Average time per layer: 
I1025 14:25:24.150682 18229 caffe.cpp:409]      cifar    forward: 0.0128384 ms.
I1025 14:25:24.150688 18229 caffe.cpp:412]      cifar    backward: 0.0012096 ms.
I1025 14:25:24.150703 18229 caffe.cpp:409]      conv1    forward: 1.97368 ms.
I1025 14:25:24.150707 18229 caffe.cpp:412]      conv1    backward: 1.77903 ms.
I1025 14:25:24.150738 18229 caffe.cpp:409]      pool1    forward: 0.794051 ms.
I1025 14:25:24.150743 18229 caffe.cpp:412]      pool1    backward: 3.74093 ms.
I1025 14:25:24.150745 18229 caffe.cpp:409]      relu1    forward: 0.249007 ms.
I1025 14:25:24.150758 18229 caffe.cpp:412]      relu1    backward: 0.421526 ms.
I1025 14:25:24.150761 18229 caffe.cpp:409]      norm1    forward: 6.559 ms.
I1025 14:25:24.150764 18229 caffe.cpp:412]      norm1    backward: 34.0349 ms.
I1025 14:25:24.150777 18229 caffe.cpp:409]      conv2    forward: 1.95953 ms.
I1025 14:25:24.150781 18229 caffe.cpp:412]      conv2    backward: 3.82123 ms.
I1025 14:25:24.150795 18229 caffe.cpp:409]      relu2    forward: 0.214522 ms.
I1025 14:25:24.150799 18229 caffe.cpp:412]      relu2    backward: 0.383297 ms.
I1025 14:25:24.150802 18229 caffe.cpp:409]      pool2    forward: 0.211263 ms.
I1025 14:25:24.150805 18229 caffe.cpp:412]      pool2    backward: 0.516095 ms.
I1025 14:25:24.150810 18229 caffe.cpp:409]      norm2    forward: 1.18516 ms.
I1025 14:25:24.150812 18229 caffe.cpp:412]      norm2    backward: 2.44542 ms.
I1025 14:25:24.150816 18229 caffe.cpp:409]      conv3    forward: 0.861409 ms.
I1025 14:25:24.150820 18229 caffe.cpp:412]      conv3    backward: 1.59151 ms.
I1025 14:25:24.150821 18229 caffe.cpp:409]      relu3    forward: 0.030391 ms.
I1025 14:25:24.150825 18229 caffe.cpp:412]      relu3    backward: 0.140596 ms.
I1025 14:25:24.150828 18229 caffe.cpp:409]      pool3    forward: 0.0932717 ms.
I1025 14:25:24.150832 18229 caffe.cpp:412]      pool3    backward: 0.270544 ms.
I1025 14:25:24.150835 18229 caffe.cpp:409]        ip1    forward: 0.0853786 ms.
I1025 14:25:24.150840 18229 caffe.cpp:412]        ip1    backward: 0.0700339 ms.
I1025 14:25:24.150846 18229 caffe.cpp:409]       loss    forward: 0.116995 ms.
I1025 14:25:24.150852 18229 caffe.cpp:412]       loss    backward: 0.0239635 ms.
I1025 14:25:24.150864 18229 caffe.cpp:417] Average Forward pass: 15.1733 ms.
I1025 14:25:24.150871 18229 caffe.cpp:419] Average Backward pass: 50.7023 ms.
I1025 14:25:24.150880 18229 caffe.cpp:421] Average Forward-Backward: 65.9452 ms.
I1025 14:25:24.150887 18229 caffe.cpp:423] Total Time: 3297.26 ms.
I1025 14:25:24.150894 18229 caffe.cpp:424] *** Benchmark ends ***

3. 泛化测试:

classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/1.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/2.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/3.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/4.jpg

classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/5.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/6.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/7.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/8.jpg
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/1.jpg
---------- Prediction for /home/sea/Downloads/images/cat/1.jpg ----------
0.4068 - "1 airplane"
0.1793 - "5 deer"
0.1201 - "9 ship"
0.0827 - "4 cat"
0.0691 - "3 bird"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/2.jpg
---------- Prediction for /home/sea/Downloads/images/cat/2.jpg ----------
0.7290 - "1 airplane"
0.1371 - "3 bird"
0.0438 - "10 truck"
0.0267 - "8 horse"
0.0254 - "4 cat"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/3.jpg
---------- Prediction for /home/sea/Downloads/images/cat/3.jpg ----------
0.2912 - "9 ship"
0.2754 - "7 frog"
0.2670 - "1 airplane"
0.0595 - "10 truck"
0.0435 - "3 bird"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/4.jpg
---------- Prediction for /home/sea/Downloads/images/cat/4.jpg ----------
0.3902 - "4 cat"
0.3171 - "10 truck"
0.0842 - "9 ship"
0.0800 - "1 airplane"
0.0374 - "6 dog"
sea@sea-X550JK:~/caffe$ 
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/5.jpg
---------- Prediction for /home/sea/Downloads/images/cat/5.jpg ----------
0.9190 - "1 airplane"
0.0461 - "10 truck"
0.0258 - "9 ship"
0.0027 - "2 automobile"
0.0023 - "3 bird"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/6.jpg
---------- Prediction for /home/sea/Downloads/images/cat/6.jpg ----------
0.7168 - "4 cat"
0.0823 - "7 frog"
0.0545 - "8 horse"
0.0464 - "10 truck"
0.0419 - "9 ship"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/7.jpg
---------- Prediction for /home/sea/Downloads/images/cat/7.jpg ----------
0.9785 - "10 truck"
0.0169 - "1 airplane"
0.0019 - "4 cat"
0.0015 - "9 ship"
0.0007 - "2 automobile"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/cat/8.jpg
---------- Prediction for /home/sea/Downloads/images/cat/8.jpg ----------
0.4046 - "7 frog"
0.3872 - "5 deer"
0.1262 - "4 cat"
0.0483 - "10 truck"
0.0226 - "3 bird"

还是25%的正确比率。尴尬。

classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/1.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/2.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/3.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/4.jpg

classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/5.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/6.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/7.jpg
classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/8.jpg


sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/1.jpg
---------- Prediction for /home/sea/Downloads/images/horse/1.jpg ----------
0.6260 - "1 airplane"
0.3320 - "10 truck"
0.0188 - "2 automobile"
0.0123 - "8 horse"
0.0093 - "3 bird"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/2.jpg
---------- Prediction for /home/sea/Downloads/images/horse/2.jpg ----------
0.4816 - "10 truck"
0.3417 - "1 airplane"
0.0700 - "3 bird"
0.0438 - "8 horse"
0.0344 - "2 automobile"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/3.jpg
---------- Prediction for /home/sea/Downloads/images/horse/3.jpg ----------
0.4899 - "1 airplane"
0.3042 - "8 horse"
0.0510 - "3 bird"
0.0483 - "5 deer"
0.0292 - "6 dog"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/4.jpg
---------- Prediction for /home/sea/Downloads/images/horse/4.jpg ----------
0.5670 - "10 truck"
0.1927 - "8 horse"
0.1813 - "1 airplane"
0.0370 - "3 bird"
0.0071 - "4 cat"
sea@sea-X550JK:~/caffe$ 
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/5.jpg
---------- Prediction for /home/sea/Downloads/images/horse/5.jpg ----------
0.2184 - "1 airplane"
0.1759 - "5 deer"
0.1625 - "8 horse"
0.1279 - "3 bird"
0.0847 - "10 truck"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/6.jpg
---------- Prediction for /home/sea/Downloads/images/horse/6.jpg ----------
0.2841 - "7 frog"
0.1913 - "6 dog"
0.1671 - "8 horse"
0.1276 - "5 deer"
0.0719 - "3 bird"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/7.jpg
---------- Prediction for /home/sea/Downloads/images/horse/7.jpg ----------
0.8176 - "8 horse"
0.0612 - "6 dog"
0.0538 - "3 bird"
0.0346 - "10 truck"
0.0137 - "4 cat"
sea@sea-X550JK:~/caffe$ classification ./examples/cifar10/cifar10_full.prototxt ./examples/cifar10/cifar10_full_iter_70000.caffemodel.h5 ./examples/cifar10/mean.binaryproto ./examples/cifar10/labels.txt   ~/Downloads/images/horse/8.jpg
---------- Prediction for /home/sea/Downloads/images/horse/8.jpg ----------
0.3815 - "5 deer"
0.1820 - "8 horse"
0.1030 - "7 frog"
0.1028 - "1 airplane"
0.1021 - "6 dog"

换马试试, 正确率为12.5%。   继续很低。 但这并没有错的。

 

考察模型  resnet152_v2.caffemodel:

caffe    test    -model    /media/sea/wsWin10/model-zoo/ResNet-152/deploy.prototxt  \
-weights /media/sea/wsWin10/model-zoo/ResNet-152/resnet152_v2.caffemodel -gpu 0