如何在使用Caffe时在训练过程中添加val过程

时间:2017-05-25 13:10:41

标签: machine-learning neural-network deep-learning caffe

我使用的是DeepLabv2 VGG16型号。 我在之前修改过的某个参数train.prototxt中为val添加数据层和精度层,然后我尝试用caffe命令训练,但是我遇到了这个问题:

`I0525 21:59:23.533233  2223 net.cpp:226] pool4 needs backward computation.
I0525 21:59:23.533237  2223 net.cpp:226] relu4_3 needs backward computation.
I0525 21:59:23.533241  2223 net.cpp:226] conv4_3 needs backward computation.
I0525 21:59:23.533246  2223 net.cpp:226] relu4_2 needs backward computation.
I0525 21:59:23.533251  2223 net.cpp:226] conv4_2 needs backward computation.
I0525 21:59:23.533254  2223 net.cpp:226] relu4_1 needs backward computation.
I0525 21:59:23.533258  2223 net.cpp:226] conv4_1 needs backward computation.
I0525 21:59:23.533262  2223 net.cpp:226] pool3 needs backward computation.
I0525 21:59:23.533267  2223 net.cpp:226] relu3_3 needs backward computation.
I0525 21:59:23.533272  2223 net.cpp:226] conv3_3 needs backward computation.
I0525 21:59:23.533275  2223 net.cpp:226] relu3_2 needs backward computation.
I0525 21:59:23.533279  2223 net.cpp:226] conv3_2 needs backward computation.
I0525 21:59:23.533284  2223 net.cpp:226] relu3_1 needs backward computation.
I0525 21:59:23.533288  2223 net.cpp:226] conv3_1 needs backward computation.
I0525 21:59:23.533293  2223 net.cpp:226] pool2 needs backward computation.
I0525 21:59:23.533296  2223 net.cpp:226] relu2_2 needs backward computation.
I0525 21:59:23.533301  2223 net.cpp:226] conv2_2 needs backward computation.
I0525 21:59:23.533305  2223 net.cpp:226] relu2_1 needs backward computation.
I0525 21:59:23.533309  2223 net.cpp:226] conv2_1 needs backward computation.
I0525 21:59:23.533313  2223 net.cpp:226] pool1 needs backward computation.
I0525 21:59:23.533318  2223 net.cpp:226] relu1_2 needs backward computation.
I0525 21:59:23.533321  2223 net.cpp:226] conv1_2 needs backward computation.
I0525 21:59:23.533325  2223 net.cpp:226] relu1_1 needs backward computation.
I0525 21:59:23.533329  2223 net.cpp:226] conv1_1 needs backward computation.
I0525 21:59:23.533334  2223 net.cpp:228] data does not need backward computation.
I0525 21:59:23.533339  2223 net.cpp:270] This network produces output accuracy
I0525 21:59:23.533365  2223 net.cpp:283] Network initialization done.
F0525 21:59:23.533455  2223 solver.cpp:126] Check failed: param_.test_iter_size() == num_test_nets (1 vs. 0) test_iter must be specified for each test network.
*** Check failure stack trace: ***
    @     0x7ff58c9eedaa  (unknown)
    @     0x7ff58c9eece4  (unknown)
    @     0x7ff58c9ee6e6  (unknown)
    @     0x7ff58c9f1687  (unknown)
    @     0x7ff58d1a19fe  caffe::Solver<>::InitTestNets()
    @     0x7ff58d1a1ded  caffe::Solver<>::Init()
    @     0x7ff58d1a20da  caffe::Solver<>::Solver()
    @     0x7ff58d041123  caffe::Creator_SGDSolver<>()
    @           0x40ea7e  caffe::SolverRegistry<>::CreateSolver()
    @           0x407bb2  train()
    @           0x4059dc  main
    @     0x7ff58bcfcf45  (unknown)
    @           0x406111  (unknown)
    @              (nil)  (unknown)`

我在train.prototxt中添加的图层是:

第一个添加的图层:

layer {
  name: "data"
  type: "ImageSegData"
  top: "data"
  top: "label"
  top: "data_dim"
  include {
    phase: TEST
  }
  transform_param {
    mirror: false
    crop_size: 321
    mean_value: 104.008
    mean_value: 116.669
    mean_value: 122.675
  }
  image_data_param {
    root_folder: "/media/TOSHIBA_EXT/dataset/train-data"
    source: "/media/TOSHIBA_EXT/dataset/train-data/val.txt"
    batch_size: 10
    shuffle: false
    label_type: PIXEL
  }
}

第二个添加的图层:

layer {
  name: "accuracy"
  type: "SegAccuracy"
  bottom: "fc8_voc"
  bottom: "label_shrink"
  top: "accuracy"
  include {
    phase: TEST
  }
  seg_accuracy_param {
    ignore_label: 255
  }
}

在使用DeepLab时,您能告诉我如何在训练过程中添加val进程吗?

0 个答案:

没有答案