我在caffe中创建了一个名为"myLayer"
的"Python"
层,并将其用于网络train_val.prototxt
中。插入该层的方式如下:
layer {
name: "my_py_layer"
type: "Python"
bottom: "in"
top: "out"
python_param {
module: "my_module_name"
layer: "myLayer"
}
include { phase: TRAIN } # THIS IS THE TRICKY PART!
}
现在,我的层仅参与网络的TRAIN
ing阶段,
我该如何在我的层的setup
函数中知道这一点呢?
class myLayer(caffe.Layer):
def setup(self, bottom, top):
# I want to know here what is the phase?!!
...
PS,
我也在“Caffe用户”Google群组上发布了这个问题。如果那里有任何消息,我会更新的。