在Caffe Protxt文件中,列车和测试阶段是做什么的?

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (71)

我是新来的,谢谢!

in https://github.com/BVLC/caffe/blob/master/src/caffe/proto/caffe.proto

I saw 1 uncommented enum variable phase. it has 2 option TRAIN and TEST.

enum Phase {
   TRAIN = 0;
   TEST = 1;
}

how did they work? I saw a model recently has this 2 phase too. the .prototxt file looks like:

name: "CIFAR10_full"
layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  data_param {
    source: "CIFAR-10/cifar10_train_lmdb"
    backend: LMDB
    batch_size: 200
  }
  transform_param {
    mirror: true
  }
  include: { phase: TRAIN }
}
layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  data_param {
    source: "CIFAR-10/cifar10_test_lmdb"
    backend: LMDB
    batch_size: 100
  }
  transform_param {
    mirror: false
  }
  include: { phase: TEST }
}

我可以从火车阶段切换到测试阶段吗?开关在哪里?

提问于
用户回答回答于

在培训期间(即执行$CAFFE_ROOT/tools/caffe train [...]Caffe可以在训练阶段和测试阶段交替进行:即在训练阶段参数改变,而在测试阶段,参数是固定的,模型只运行前馈实例来估计模型的当前性能。

It is quite natural to use two different data sets for training and testing, and this is why you use the different phase values.

You can read more about the train/test iterations here.

用户回答回答于

TRAIN指定培训期间使用的模型的层。

TEST指定测试期间使用的模型的层。

Thus, you can define 2 models in the single prototxt file: one model for training and one model for testing.

Info on this can be found in the Model Definition section of the web page http://caffe.berkeleyvision.org/gathered/examples/imagenet.html

所属标签

可能回答问题的人

  • Hanzo

    6 粉丝0 提问7 回答
  • Richel

    9 粉丝0 提问3 回答
  • software

    10 粉丝489 提问2 回答
  • 不吃貓的鱼oo

    7 粉丝466 提问2 回答

扫码关注云+社区

领取腾讯云代金券