Testing accuracy in Caffe googlenet!!

123 views
Skip to first unread message

Ashish Singh

unread,
Mar 20, 2018, 2:11:44 AM3/20/18
to Caffe Users
Hello,

I am new to Caffe and trying to learn from some online tutorials..:)
I have a dataset with 3 classes.
I want to train them using Googlenet.

First I started with default setting in 'train_val.prototxt'.
This results in error: F0320 14:41:31.616338 15958 accuracy_layer.cpp:25] Check failed: top_k_ <= bottom[0]->count() / bottom[1]->count() (5 vs. 3) top_k must be less than or equal to the number of classes.

After changing "top_k:5" --> "top_k: 3" for layer name:"loss1/top-5"

It results as (Manually stopping) :
...
...
...
I0320 13:00:41.167989 22705 sgd_solver.cpp:105] Iteration 3320, lr = 0.00999308
I0320 13:09:28.193434 22707 data_layer.cpp:73] Restarting data prefetching from start.
I0320 13:16:47.417879 22705 solver.cpp:218] Iteration 3360 (0.0413972 iter/s, 966.249s/40 iters), loss = 0.00119048
I0320 13:16:47.418062 22705 solver.cpp:237]     Train net output #0: loss1/loss1 = 0.00159519 (* 0.3 = 0.000478556 loss)
I0320 13:16:47.418087 22705 solver.cpp:237]     Train net output #1: loss2/loss2 = 0.000424438 (* 0.3 = 0.000127332 loss)
I0320 13:16:47.418107 22705 solver.cpp:237]     Train net output #2: loss3/loss3 = 0.000334481 (* 1 = 0.000334481 loss)
I0320 13:16:47.418117 22705 sgd_solver.cpp:105] Iteration 3360, lr = 0.009993
I0320 13:32:43.125373 22705 solver.cpp:218] Iteration 3400 (0.0418538 iter/s, 955.707s/40 iters), loss = 0.00936547
I0320 13:32:43.125566 22705 solver.cpp:237]     Train net output #0: loss1/loss1 = 0.000500842 (* 0.3 = 0.000150253 loss)
I0320 13:32:43.125591 22705 solver.cpp:237]     Train net output #1: loss2/loss2 = 0.000146092 (* 0.3 = 4.38276e-05 loss)
I0320 13:32:43.125597 22705 solver.cpp:237]     Train net output #2: loss3/loss3 = 0.000610529 (* 1 = 0.000610529 loss)
I0320 13:32:43.125607 22705 sgd_solver.cpp:105] Iteration 3400, lr = 0.00999291
^CI0320 13:34:19.846009 22705 solver.cpp:447] Snapshotting to binary proto file models/bvlc_googlenet/bvlc_googlenet_quick_iter_3405.caffemodel
I0320 13:34:19.993010 22705 sgd_solver.cpp:273] Snapshotting solver state to binary proto file models/bvlc_googlenet/bvlc_googlenet_quick_iter_3405.solverstate
I0320 13:34:20.062336 22705 solver.cpp:294] Optimization stopped early.
I0320 13:34:20.062367 22705 caffe.cpp:259] Optimization Done.

>>>>>>     Questions     <<<<<<<<
Q 1: Do I need to change each Top_k values for all losses?
Q 2: How do I get test accuracy results? along with train loss?
Q 3: What are significance of test_iter and test_interval in quick_solver.prototxt?

Regards

Ashish

Przemek D

unread,
Mar 20, 2018, 8:32:16 AM3/20/18
to Caffe Users
1. Compare what top_k does with a classifier layer num_output.
2. Results of the test should appear in the training log, as long as you have the test configured (see the next answer). I recommend running a simple example to see how this works.
3. Check the examples, specifically the MNIST on LeNet - the example solver explains most of the options in the comments.

Ashish Singh

unread,
Apr 1, 2018, 11:20:59 PM4/1/18
to Caffe Users
Thank  you..
I have made some changes in the solver file.
Reply all
Reply to author
Forward
0 new messages