Open lqian opened 5 years ago
在cifar10数据上做了个小测验, base_lr=0.1训练60000轮后,测试精度只有58.74%, 日志显示train loss过大,应该上训练未充分, base_lr=0.0001训练60000轮后,只有28.17%的精度。 ` I1013 11:38:29.757405 3189 caffe.cpp:330] Softmax1 = 1.43176 (* 1 = 1.43176 loss) I1013 11:38:29.757411 3189 caffe.cpp:330] accuracy = 0.5842
.... base_lr=0.001 I1013 16:11:04.564793 4153 solver.cpp:447] Snapshotting to binary proto file examples/cifar10/cifar10_MnasNet_iter_60000.caffemodel I1013 16:11:04.612725 4153 sgd_solver.cpp:273] Snapshotting solver state to binary proto file examples/cifar10/cifar10_MnasNet_iter_60000.solverstate I1013 16:11:04.629349 4153 solver.cpp:330] Iteration 60000, Testing net (#0) I1013 16:11:09.132675 4173 data_layer.cpp:73] Restarting data prefetching from start. I1013 16:11:09.322088 4153 solver.cpp:397] Test net output #0: Softmax1 = 2.14012 (* 1 = 2.14012 loss) I1013 16:11:09.322113 4153 solver.cpp:397] Test net output #1: accuracy = 0.2817
` caffe time命令输出MnasNet的gpu耗时在14ms以上,
` ./build/tools/caffe time -iterations=100 -gpu=0 -model=examples/cifar10/train_MnasNet.prototxt ....
I1013 12:00:47.575592 3703 caffe.cpp:409] Pooling1 forward: 0.0136704 ms. I1013 12:00:47.575600 3703 caffe.cpp:412] Pooling1 backward: 0.014039 ms. I1013 12:00:47.575608 3703 caffe.cpp:409] fc1 forward: 0.038953 ms. I1013 12:00:47.575616 3703 caffe.cpp:412] fc1 backward: 0.0232038 ms. I1013 12:00:47.575623 3703 caffe.cpp:409] Softmax1 forward: 0.101257 ms. I1013 12:00:47.575630 3703 caffe.cpp:412] Softmax1 backward: 0.0176986 ms. I1013 12:00:47.575664 3703 caffe.cpp:417] Average Forward pass: 14.2767 ms. I1013 12:00:47.575672 3703 caffe.cpp:419] Average Backward pass: 36.3857 ms. I1013 12:00:47.575690 3703 caffe.cpp:421] Average Forward-Backward: 50.905 ms. I1013 12:00:47.575698 3703 caffe.cpp:423] Total Time: 5090.5 ms. I1013 12:00:47.575704 3703 caffe.cpp:424] Benchmark ends
` 这个性能比darknet-19差多了, 大神能否提供一些测试的性能数据作为参考。
训练用的solver文件 `
net: "examples/cifar10/train_MnasNet.prototxt" test_iter: 100 test_interval: 1000 base_lr: 0.0001 momentum: 0.9 weight_decay: 0.005 lr_policy: "step" gamma: 1 stepsize: 5000 display: 100 max_iter: 160000 snapshot: 10000 snapshot_prefix: "examples/cifar10/cifar10_MnasNet" solver_mode: GPU ` @LiJianfei06
@lqian 我上传了一个之前在猫狗分类是训练的模型,你可以试一下(数据集划分了20000张训练图,5000张测试图,初步训练了一下精度96.3%以上吧) cifar10你是怎么训练的?这个网络文件下采样总共是32。
在cifar10数据上做了个小测验, base_lr=0.1训练60000轮后,测试精度只有58.74%, 日志显示train loss过大,应该上训练未充分, base_lr=0.0001训练60000轮后,只有28.17%的精度。 ` I1013 11:38:29.757405 3189 caffe.cpp:330] Softmax1 = 1.43176 (* 1 = 1.43176 loss) I1013 11:38:29.757411 3189 caffe.cpp:330] accuracy = 0.5842
.... base_lr=0.001 I1013 16:11:04.564793 4153 solver.cpp:447] Snapshotting to binary proto file examples/cifar10/cifar10_MnasNet_iter_60000.caffemodel I1013 16:11:04.612725 4153 sgd_solver.cpp:273] Snapshotting solver state to binary proto file examples/cifar10/cifar10_MnasNet_iter_60000.solverstate I1013 16:11:04.629349 4153 solver.cpp:330] Iteration 60000, Testing net (#0) I1013 16:11:09.132675 4173 data_layer.cpp:73] Restarting data prefetching from start. I1013 16:11:09.322088 4153 solver.cpp:397] Test net output #0: Softmax1 = 2.14012 (* 1 = 2.14012 loss) I1013 16:11:09.322113 4153 solver.cpp:397] Test net output #1: accuracy = 0.2817
` caffe time命令输出MnasNet的gpu耗时在14ms以上,
` ./build/tools/caffe time -iterations=100 -gpu=0 -model=examples/cifar10/train_MnasNet.prototxt ....
I1013 12:00:47.575592 3703 caffe.cpp:409] Pooling1 forward: 0.0136704 ms. I1013 12:00:47.575600 3703 caffe.cpp:412] Pooling1 backward: 0.014039 ms. I1013 12:00:47.575608 3703 caffe.cpp:409] fc1 forward: 0.038953 ms. I1013 12:00:47.575616 3703 caffe.cpp:412] fc1 backward: 0.0232038 ms. I1013 12:00:47.575623 3703 caffe.cpp:409] Softmax1 forward: 0.101257 ms. I1013 12:00:47.575630 3703 caffe.cpp:412] Softmax1 backward: 0.0176986 ms. I1013 12:00:47.575664 3703 caffe.cpp:417] Average Forward pass: 14.2767 ms. I1013 12:00:47.575672 3703 caffe.cpp:419] Average Backward pass: 36.3857 ms. I1013 12:00:47.575690 3703 caffe.cpp:421] Average Forward-Backward: 50.905 ms. I1013 12:00:47.575698 3703 caffe.cpp:423] Total Time: 5090.5 ms. I1013 12:00:47.575704 3703 caffe.cpp:424] Benchmark ends
` 这个性能比darknet-19差多了, 大神能否提供一些测试的性能数据作为参考。
训练用的solver文件 `
net: "examples/cifar10/train_MnasNet.prototxt" test_iter: 100 test_interval: 1000 base_lr: 0.0001 momentum: 0.9 weight_decay: 0.005 lr_policy: "step" gamma: 1 stepsize: 5000 display: 100 max_iter: 160000 snapshot: 10000 snapshot_prefix: "examples/cifar10/cifar10_MnasNet" solver_mode: GPU ` @LiJianfei06