1

Caffe で LMDB ファイルのテスト フェーズのみを設定する方法を知りたいです。私はすでにモデルをトレーニングしており、すべてが良好に見え、損失が減少し、1 つずつ読み込まれた画像の出力も良好に見えます。

別の LMDB テスト セットで自分のモデルがどのように機能するかを確認したいのですが、正常に実行できないようです。私の損失関数は既に caffe で定義されており、再定義する必要があるため、一度に 1 つずつ画像を読み込んでループを実行するのは理想的ではありません。

これは私がこれまでに得たものですが、この結果は意味がありません。列車セットからの損失とこれから得られる損失を比較すると、それらは一致しません (桁違いに異なります)。私の問題が何であるか誰かが知っていますか?

caffe.set_device(0)
caffe.set_mode_gpu()

net = caffe.Net('/home/jeremy/Desktop/caffestuff/JP_Kitti/all_proto/mirror_shuffle/deploy_JP.prototxt','/home/jeremy/Desktop/caffestuff/JP_Kitti/all_proto/mirror_shuffle/snapshot_iter_10000.caffemodel',caffe.TEST)


solver = None  # ignore this workaround for lmdb data (can't instantiate two solvers on the same data)
solver = caffe.SGDSolver('/home/jeremy/Desktop/caffestuff/JP_Kitti/all_proto/mirror_shuffle/lenet_auto_solverJP_test.prototxt')
niter = 100
test_loss = zeros(niter)
count = 0
for it in range(niter):
    solver.test_nets[0].forward()  # SGD by Caffe

    # store the test loss

    test_loss[count] = solver.test_nets[0].blobs['loss']
    print(solver.test_nets[0].blobs['loss'].data)
    count = count+1
4

1 に答える 1