0
私は微調整ネットワークCaffeNetを使用して画像を分類しようとします。私はCaffeのチュートリアルに従い、列車ファイルの出力数を3に変更しました。また、最初の2つの畳み込みレイヤの学習を無効にしました。何らかの理由で私が訓練されたモデルでクラシファイアを使用するとき、私はテストセットから各画像のすべてのクラスに対して0.3を得ています。DNNで奇妙な分類出力
number of classes: 3
train set size: 6570 images (80%)
test set size: 1645 images (20%)
ソルバー:
net: "train.prototxt"
test_iter: 100
test_interval: 1000
base_lr: 0.0001
lr_policy: "step"
gamma: 0.1
stepsize: 20000
display: 200
max_iter: 60000
momentum: 0.9
weight_decay: 0.0005
snapshot: 10000
snapshot_prefix: "snapshot"
solver_mode: GPU
私はトレーニングを実行する方法:
caffe train -solver solver.prototxt -weights bvlc_reference_caffenet.caffemodel
いくつかの出力:
I0531 00:35:52.622647 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:36:02.699782 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:36:03.900009 5528 solver.cpp:218] Iteration 3600 (10.1266 iter/s, 19.7499s/200 iters), loss = 0.679402
I0531 00:36:03.900009 5528 solver.cpp:237] Train net output #0: loss = 0.679402 (* 1 = 0.679402 loss)
I0531 00:36:03.900009 5528 sgd_solver.cpp:105] Iteration 3600, lr = 0.0001
I0531 00:41:20.139937 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:41:30.934025 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:41:34.199774 5528 solver.cpp:218] Iteration 6800 (9.66881 iter/s, 20.6851s/200 iters), loss = 0.451174
I0531 00:41:34.199774 5528 solver.cpp:237] Train net output #0: loss = 0.451174 (* 1 = 0.451174 loss)
I0531 00:41:34.199774 5528 sgd_solver.cpp:105] Iteration 6800, lr = 0.0001
I0531 00:41:41.794001 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:41:52.743448 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:41:55.126147 5528 solver.cpp:330] Iteration 7000, Testing net (#0)
I0531 00:41:55.891929 3704 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:41:58.393698 3704 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:41:58.862452 5528 solver.cpp:397] Test net output #0: accuracy = 0.6952
I0531 00:41:58.862452 5528 solver.cpp:397] Test net output #1: loss = 0.873388 (* 1 = 0.873388 loss)
I0531 00:43:08.320360 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:43:18.514559 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:43:18.920881 5528 solver.cpp:218] Iteration 7800 (10.0073 iter/s, 19.9854s/200 iters), loss = 0.196175
I0531 00:43:18.920881 5528 solver.cpp:237] Train net output #0: loss = 0.196175 (* 1 = 0.196175 loss)
I0531 00:43:18.920881 5528 sgd_solver.cpp:105] Iteration 7800, lr = 0.0001
I0531 00:43:28.660408 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:43:38.561293 5528 solver.cpp:330] Iteration 8000, Testing net (#0)
I0531 00:43:40.405230 3704 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:43:42.077230 5528 solver.cpp:397] Test net output #0: accuracy = 0.7004
I0531 00:43:42.077230 5528 solver.cpp:397] Test net output #1: loss = 0.991567 (* 1 = 0.991567 loss)
I0531 00:45:22.426592 3704 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:45:24.761165 3704 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:45:25.329238 5528 solver.cpp:397] Test net output #0: accuracy = 0.6856
I0531 00:45:25.329238 5528 solver.cpp:397] Test net output #1: loss = 1.08582 (* 1 = 1.08582 loss)
I0531 00:45:25.394567 5528 solver.cpp:218] Iteration 9000 (8.39955 iter/s, 23.8108s/200 iters), loss = 0.107816
I0531 00:45:25.394567 5528 solver.cpp:237] Train net output #0: loss = 0.107816 (* 1 = 0.107816 loss)
I0531 00:46:49.099460 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:46:59.269830 2944 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:47:03.997443 5528 solver.cpp:447] Snapshotting to binary proto file snapshot_iter_10000.caffemodel
I0531 00:47:05.185039 5528 sgd_solver.cpp:273] Snapshotting solver state to binary proto file snapshot_iter_10000.solverstate
I0531 00:47:05.403774 5528 solver.cpp:330] Iteration 10000, Testing net (#0)
I0531 00:47:07.122831 3704 data_layer.cpp:73] Restarting data prefetching from start.
I0531 00:47:08.870923 5528 solver.cpp:397] Test net output #0: accuracy = 0.7012
I0531 00:47:08.870923 5528 solver.cpp:397] Test net output #1: loss = 1.18649 (* 1 = 1.18649 loss)
I0531 00:47:08.964664 5528 solver.cpp:218] Iteration 10000 (8.12416 iter/s, 24.6179s/200 iters), loss = 0.0347012
I0531 00:47:08.964664 5528 solver.cpp:237] Train net output #0: loss = 0.0347012 (* 1 = 0.0347012 loss)
I0531 00:47:08.964664 5528 sgd_solver.cpp:105] Iteration 10000, lr = 0.0001
私は分類実行方法:
をclassification deploy.prototxt snapshot_iter_10000.caffemodel labels.txt ..\test
いくつかの出力:
"0.jpg",0.333333,0.333333,0.333333
"1.jpg",0.333333,0.333333,0.333333
"10.jpg",0.333333,0.333333,0.333333
"100.jpg",0.333333,0.333333,0.333333
"101.jpg",0.333333,0.333333,0.333333
"102.jpg",0.333333,0.333333,0.333333,
"103.jpg",0.333333,0.333333,0.333333
私は50%と同じ結果を得ている70%の精度でいくつかの理由 - すべてのクラスには0.3を持っています。
しかし、なぜテストセットで70%を示していますか? –
私はこの最後の行を得ていませんでした。「何らかの理由で70%の正確さで私は50%と同じ結果を得ています - すべてのクラスに0.3があります」 ''あなたはトレーニングの精度について話していますか?詳しく教えてください。 –
はい、トレーニングの正確さを意味します。反復9000では70%の精度があることがわかります。 –