学习笔记:自训练Cifar10网络数据结果

看了那么多深度网络的结构,于是上个月就开始自己拿数据来训练。

训练的数据需要尽量多一点。

首先拿101_ObjectCategories的数据来试一下。101_ObjectCategories里面有的类别数据量太少,于是先选择两类,airplanes 和Motorbikes  每一类有800张左右的图片。

训练图片还是32*32. 模型基本没做大的修改。直接训练两类的结果 迭代到500次,准确率就达到99%,最后进行了4000次迭代。


I0408 23:46:38.619588 11493 net.cpp:56] Memory required for data: 0
I0408 23:46:38.619616 11493 net.cpp:67] Creating Layer cifar
I0408 23:46:38.619624 11493 net.cpp:356] cifar -> data
I0408 23:46:38.619638 11493 net.cpp:356] cifar -> label
I0408 23:46:38.619648 11493 net.cpp:96] Setting up cifar
I0408 23:46:38.619704 11493 data_layer.cpp:68] Opening lmdb data/101small/test32/101_val_lmdb
I0408 23:46:38.619730 11493 data_layer.cpp:128] output data size: 100,3,32,32
I0408 23:46:38.619743 11493 base_data_layer.cpp:36] Loading mean file fromdata/101small/test32/mean.binaryproto
I0408 23:46:38.620277 11493 base_data_layer.cpp:64] Initializing prefetch
I0408 23:46:38.620301 11493 base_data_layer.cpp:66] Prefetch initialized.
I0408 23:46:38.620309 11493 net.cpp:103] Top shape: 100 3 32 32 (307200)
I0408 23:46:38.620316 11493 net.cpp:103] Top shape: 100 1 1 1 (100)
I0408 23:46:38.620319 11493 net.cpp:113] Memory required for data: 1229200
I0408 23:46:38.620331 11493 net.cpp:67] Creating Layer label_cifar_1_split
I0408 23:46:38.620337 11493 net.cpp:394] label_cifar_1_split <- label
I0408 23:46:38.620347 11493 net.cpp:356] label_cifar_1_split -> label_cifar_1_split_0
I0408 23:46:38.620357 11493 net.cpp:356] label_cifar_1_split -> label_cifar_1_split_1
I0408 23:46:38.620367 11493 net.cpp:96] Setting up label_cifar_1_split
I0408 23:46:38.620374 11493 net.cpp:103] Top shape: 100 1 1 1 (100)
I0408 23:46:38.620379 11493 net.cpp:103] Top shape: 100 1 1 1 (100)
I0408 23:46:38.620384 11493 net.cpp:113] Memory required for data: 1230000
I0408 23:46:38.620395 11493 net.cpp:67] Creating Layer conv1
I0408 23:46:38.620403 11493 net.cpp:394] conv1 <- data
I0408 23:46:38.620412 11493 net.cpp:356] conv1 -> conv1
I0408 23:46:38.620422 11493 net.cpp:96] Setting up conv1
I0408 23:46:38.620764 11493 net.cpp:103] Top shape: 100 32 32 32 (3276800)
I0408 23:46:38.620771 11493 net.cpp:113] Memory required for data: 14337200
I0408 23:46:38.620786 11493 net.cpp:67] Creating Layer pool1
I0408 23:46:38.620793 11493 net.cpp:394] pool1 <- conv1
I0408 23:46:38.620803 11493 net.cpp:356] pool1 -> pool1
I0408 23:46:38.620812 11493 net.cpp:96] Setting up pool1
I0408 23:46:38.620820 11493 net.cpp:103] Top shape: 100 32 16 16 (819200)
I0408 23:46:38.620826 11493 net.cpp:113] Memory required for data: 17614000
I0408 23:46:38.620834 11493 net.cpp:67] Creating Layer relu1
I0408 23:46:38.620839 11493 net.cpp:394] relu1 <- pool1
I0408 23:46:38.620851 11493 net.cpp:345] relu1 -> pool1 (in-place)
I0408 23:46:38.620867 11493 net.cpp:96] Setting up relu1
I0408 23:46:38.620872 11493 net.cpp:103] Top shape: 100 32 16 16 (819200)
I0408 23:46:38.620877 11493 net.cpp:113] Memory required for data: 20890800
I0408 23:46:38.620887 11493 net.cpp:67] Creating Layer conv2
I0408 23:46:38.620893 11493 net.cpp:394] conv2 <- pool1
I0408 23:46:38.620903 11493 net.cpp:356] conv2 -> conv2
I0408 23:46:38.620913 11493 net.cpp:96] Setting up conv2
I0408 23:46:38.624178 11493 net.cpp:103] Top shape: 100 32 16 16 (819200)
I0408 23:46:38.624187 11493 net.cpp:113] Memory required for data: 24167600
I0408 23:46:38.624202 11493 net.cpp:67] Creating Layer relu2
I0408 23:46:38.624215 11493 net.cpp:394] relu2 <- conv2
I0408 23:46:38.624227 11493 net.cpp:345] relu2 -> conv2 (in-place)
I0408 23:46:38.624235 11493 net.cpp:96] Setting up relu2
I0408 23:46:38.624241 11493 net.cpp:103] Top shape: 100 32 16 16 (819200)
I0408 23:46:38.624245 11493 net.cpp:113] Memory required for data: 27444400
I0408 23:46:38.624253 11493 net.cpp:67] Creating Layer pool2
I0408 23:46:38.624259 11493 net.cpp:394] pool2 <- conv2
I0408 23:46:38.624269 11493 net.cpp:356] pool2 -> pool2
I0408 23:46:38.624277 11493 net.cpp:96] Setting up pool2
I0408 23:46:38.624284 11493 net.cpp:103] Top shape: 100 32 8 8 (204800)
I0408 23:46:38.624289 11493 net.cpp:113] Memory required for data: 28263600
I0408 23:46:38.624302 11493 net.cpp:67] Creating Layer conv3
I0408 23:46:38.624308 11493 net.cpp:394] conv3 <- pool2
I0408 23:46:38.624318 11493 net.cpp:356] conv3 -> conv3
I0408 23:46:38.624330 11493 net.cpp:96] Setting up conv3
I0408 23:46:38.630815 11493 net.cpp:103] Top shape: 100 64 8 8 (409600)
I0408 23:46:38.630823 11493 net.cpp:113] Memory required for data: 29902000
I0408 23:46:38.630838 11493 net.cpp:67] Creating Layer relu3
I0408 23:46:38.630846 11493 net.cpp:394] relu3 <- conv3
I0408 23:46:38.630856 11493 net.cpp:345] relu3 -> conv3 (in-place)
I0408 23:46:38.630863 11493 net.cpp:96] Setting up relu3
I0408 23:46:38.630869 11493 net.cpp:103] Top shape: 100 64 8 8 (409600)
I0408 23:46:38.630874 11493 net.cpp:113] Memory required for data: 31540400
I0408 23:46:38.630882 11493 net.cpp:67] Creating Layer pool3
I0408 23:46:38.630887 11493 net.cpp:394] pool3 <- conv3
I0408 23:46:38.630897 11493 net.cpp:356] pool3 -> pool3
I0408 23:46:38.630905 11493 net.cpp:96] Setting up pool3
I0408 23:46:38.630913 11493 net.cpp:103] Top shape: 100 64 4 4 (102400)
I0408 23:46:38.630918 11493 net.cpp:113] Memory required for data: 31950000
I0408 23:46:38.630926 11493 net.cpp:67] Creating Layer ip1
I0408 23:46:38.630933 11493 net.cpp:394] ip1 <- pool3
I0408 23:46:38.630942 11493 net.cpp:356] ip1 -> ip1
I0408 23:46:38.630951 11493 net.cpp:96] Setting up ip1
I0408 23:46:38.639205 11493 net.cpp:103] Top shape: 100 64 1 1 (6400)
I0408 23:46:38.639214 11493 net.cpp:113] Memory required for data: 31975600
I0408 23:46:38.639225 11493 net.cpp:67] Creating Layer ip2
I0408 23:46:38.639232 11493 net.cpp:394] ip2 <- ip1
I0408 23:46:38.639245 11493 net.cpp:356] ip2 -> ip2
I0408 23:46:38.639255 11493 net.cpp:96] Setting up ip2
I0408 23:46:38.639284 11493 net.cpp:103] Top shape: 100 2 1 1 (200)
I0408 23:46:38.639291 11493 net.cpp:113] Memory required for data: 31976400
I0408 23:46:38.639303 11493 net.cpp:67] Creating Layer ip2_ip2_0_split
I0408 23:46:38.639309 11493 net.cpp:394] ip2_ip2_0_split <- ip2
I0408 23:46:38.639318 11493 net.cpp:356] ip2_ip2_0_split -> ip2_ip2_0_split_0
I0408 23:46:38.639330 11493 net.cpp:356] ip2_ip2_0_split -> ip2_ip2_0_split_1
I0408 23:46:38.639339 11493 net.cpp:96] Setting up ip2_ip2_0_split
I0408 23:46:38.639346 11493 net.cpp:103] Top shape: 100 2 1 1 (200)
I0408 23:46:38.639351 11493 net.cpp:103] Top shape: 100 2 1 1 (200)
I0408 23:46:38.639355 11493 net.cpp:113] Memory required for data: 31978000
I0408 23:46:38.639364 11493 net.cpp:67] Creating Layer accuracy
I0408 23:46:38.639369 11493 net.cpp:394] accuracy <- ip2_ip2_0_split_0
I0408 23:46:38.639376 11493 net.cpp:394] accuracy <- label_cifar_1_split_0
I0408 23:46:38.639385 11493 net.cpp:356] accuracy -> accuracy
I0408 23:46:38.639396 11493 net.cpp:96] Setting up accuracy
I0408 23:46:38.639405 11493 net.cpp:103] Top shape: 1 1 1 1 (1)
I0408 23:46:38.639410 11493 net.cpp:113] Memory required for data: 31978004
I0408 23:46:38.639417 11493 net.cpp:67] Creating Layer loss
I0408 23:46:38.639423 11493 net.cpp:394] loss <- ip2_ip2_0_split_1
I0408 23:46:38.639431 11493 net.cpp:394] loss <- label_cifar_1_split_1
I0408 23:46:38.639438 11493 net.cpp:356] loss -> loss
I0408 23:46:38.639447 11493 net.cpp:96] Setting up loss
I0408 23:46:38.639458 11493 net.cpp:103] Top shape: 1 1 1 1 (1)
I0408 23:46:38.639463 11493 net.cpp:109]     with loss weight 1
I0408 23:46:38.639469 11493 net.cpp:113] Memory required for data: 31978008
I0408 23:46:38.639482 11493 net.cpp:170] loss needs backward computation.
I0408 23:46:38.639488 11493 net.cpp:172] accuracy does not need backward computation.
I0408 23:46:38.639493 11493 net.cpp:170] ip2_ip2_0_split needs backward computation.
I0408 23:46:38.639498 11493 net.cpp:170] ip2 needs backward computation.
I0408 23:46:38.639503 11493 net.cpp:170] ip1 needs backward computation.
I0408 23:46:38.639508 11493 net.cpp:170] pool3 needs backward computation.
I0408 23:46:38.639513 11493 net.cpp:170] relu3 needs backward computation.
I0408 23:46:38.639518 11493 net.cpp:170] conv3 needs backward computation.
I0408 23:46:38.639523 11493 net.cpp:170] pool2 needs backward computation.
I0408 23:46:38.639528 11493 net.cpp:170] relu2 needs backward computation.
I0408 23:46:38.639533 11493 net.cpp:170] conv2 needs backward computation.
I0408 23:46:38.639539 11493 net.cpp:170] relu1 needs backward computation.
I0408 23:46:38.639544 11493 net.cpp:170] pool1 needs backward computation.
I0408 23:46:38.639549 11493 net.cpp:170] conv1 needs backward computation.
I0408 23:46:38.639554 11493 net.cpp:172] label_cifar_1_split does not need backward computation.
I0408 23:46:38.639559 11493 net.cpp:172] cifar does not need backward computation.
I0408 23:46:38.639564 11493 net.cpp:208] This network produces output accuracy
I0408 23:46:38.639569 11493 net.cpp:208] This network produces output loss
I0408 23:46:38.639590 11493 net.cpp:467] Collecting Learning Rate and Weight Decay.
I0408 23:46:38.639598 11493 net.cpp:219] Network initialization done.
I0408 23:46:38.639603 11493 net.cpp:220] Memory required for data: 31978008
I0408 23:46:38.639637 11493 solver.cpp:41] Solver scaffolding done.
I0408 23:46:38.639643 11493 solver.cpp:160] Solving CIFAR10_quick
I0408 23:46:38.639648 11493 solver.cpp:161] Learning Rate Policy: fixed
I0408 23:46:38.639696 11493 solver.cpp:264] Iteration 0, Testing net (#0)
I0408 23:46:38.639713 11493 net.cpp:652] Copying source layer cifar
I0408 23:46:38.639721 11493 net.cpp:652] Copying source layer conv1
I0408 23:46:38.639736 11493 net.cpp:652] Copying source layer pool1
I0408 23:46:38.639749 11493 net.cpp:652] Copying source layer relu1
I0408 23:46:38.639757 11493 net.cpp:652] Copying source layer conv2
I0408 23:46:38.639770 11493 net.cpp:652] Copying source layer relu2
I0408 23:46:38.639783 11493 net.cpp:652] Copying source layer pool2
I0408 23:46:38.639796 11493 net.cpp:652] Copying source layer conv3
I0408 23:46:38.639822 11493 net.cpp:652] Copying source layer relu3
I0408 23:46:38.639832 11493 net.cpp:652] Copying source layer pool3
I0408 23:46:38.639838 11493 net.cpp:652] Copying source layer ip1
I0408 23:46:38.639858 11493 net.cpp:652] Copying source layer ip2
I0408 23:46:38.639864 11493 net.cpp:652] Copying source layer loss
I0408 23:46:38.641947 11496 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:47:34.499454 11493 solver.cpp:315]     Test net output #0: accuracy = 0.505
I0408 23:47:34.499495 11493 solver.cpp:315]     Test net output #1: loss = 0.693705 (* 1 = 0.693705 loss)
I0408 23:47:35.913596 11493 solver.cpp:209] Iteration 0, loss = 0.695267
I0408 23:47:35.913638 11493 solver.cpp:224]     Train net output #0: loss = 0.695267 (* 1 = 0.695267 loss)
I0408 23:47:35.913648 11493 solver.cpp:445] Iteration 0, lr = 0.001
I0408 23:47:51.280112 11612 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:49:55.618027 11493 solver.cpp:209] Iteration 100, loss = 0.0746845
I0408 23:49:55.618070 11493 solver.cpp:224]     Train net output #0: loss = 0.0746845 (* 1 = 0.0746845 loss)
I0408 23:49:55.618079 11493 solver.cpp:445] Iteration 100, lr = 0.001
I0408 23:50:08.198837 11752 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:52:15.567517 11493 solver.cpp:209] Iteration 200, loss = 0.0127414
I0408 23:52:15.567559 11493 solver.cpp:224]     Train net output #0: loss = 0.0127414 (* 1 = 0.0127414 loss)
I0408 23:52:15.567569 11493 solver.cpp:445] Iteration 200, lr = 0.001
I0408 23:52:25.373136 11884 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:52:44.983633 11898 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:53:04.592311 11923 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:53:24.199542 11941 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:53:43.808826 11974 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:54:03.417126 11989 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:54:23.025939 12008 data_layer.cpp:195] Restarting data prefetching from start.
I0408 23:54:35.630164 11493 solver.cpp:209] Iteration 300, loss = 0.00187102
I0408 23:54:35.630205 11493 solver.cpp:224]     Train net output #0: loss = 0.00187103 (* 1 = 0.00187103 loss)
I0408 23:54:35.630214 11493 solver.cpp:445] Iteration 300, lr = 0.001
I0408 23:56:55.706265 11493 solver.cpp:209] Iteration 400, loss = 0.000129756
I0408 23:56:55.706351 11493 solver.cpp:224]     Train net output #0: loss = 0.000129764 (* 1 = 0.000129764 loss)
I0408 23:56:55.706360 11493 solver.cpp:445] Iteration 400, lr = 0.001
I0408 23:59:14.362998 11493 solver.cpp:264] Iteration 500, Testing net (#0)
I0408 23:59:14.363026 11493 net.cpp:652] Copying source layer cifar
I0408 23:59:14.363034 11493 net.cpp:652] Copying source layer conv1
I0408 23:59:14.363039 11493 net.cpp:652] Copying source layer pool1
I0408 23:59:14.363044 11493 net.cpp:652] Copying source layer relu1
I0408 23:59:14.363049 11493 net.cpp:652] Copying source layer conv2
I0408 23:59:14.363054 11493 net.cpp:652] Copying source layer relu2
I0408 23:59:14.363059 11493 net.cpp:652] Copying source layer pool2
I0408 23:59:14.363064 11493 net.cpp:652] Copying source layer conv3
I0408 23:59:14.363068 11493 net.cpp:652] Copying source layer relu3
I0408 23:59:14.363073 11493 net.cpp:652] Copying source layer pool3
I0408 23:59:14.363077 11493 net.cpp:652] Copying source layer ip1
I0408 23:59:14.363082 11493 net.cpp:652] Copying source layer ip2
I0408 23:59:14.363088 11493 net.cpp:652] Copying source layer loss
I0408 23:59:14.364789 12279 data_layer.cpp:195] Restarting data prefetching from start.
I0409 00:00:10.128435 11493 solver.cpp:315]     Test net output #0: accuracy = 0.99
I0409 00:00:10.128469 11493 solver.cpp:315]     Test net output #1: loss = 0.0209001 (* 1 = 0.0209001 loss)
I0409 00:00:11.528825 11493 solver.cpp:209] Iteration 500, loss = 0.000202642
I0409 00:00:11.528863 11493 solver.cpp:224]     Train net output #0: loss = 0.000202651 (* 1 = 0.000202651 loss)
I0409 00:00:11.528873 11493 solver.cpp:445] Iteration 500, lr = 0.001

……

I0409 00:12:46.198276 11493 solver.cpp:315]     Test net output #0: accuracy = 0.99
I0409 00:12:46.198317 11493 solver.cpp:315]     Test net output #1: loss = 0.0209753 (* 1 = 0.0209753 loss)
I0409 00:12:47.598284 11493 solver.cpp:209] Iteration 1000, loss = 0.000381682
I0409 00:12:47.598323 11493 solver.cpp:224]     Train net output #0: loss = 0.00038169 (* 1 = 0.00038169 loss)
I0409 00:12:47.598333 11493 solver.cpp:445] Iteration 1000, lr = 0.001


训练完 将所要判断的图片输入,得出推算结果



prediction shape: (1, 2)
['motobikes']
[1]

你可能感兴趣的:(学习笔记:自训练Cifar10网络数据结果)