"Python" not accepted as layer type in the network protoxt

727 views
Skip to first unread message

Mohamed Ezz

unread,
May 11, 2016, 12:49:35 PM5/11/16
to Caffe Users
I'm trying to create a python data layer, and this is how I define the layer in the prototxt

layer {
  name: "data"
  type: "Python"
  top: "data"
  top: "label"
  python_param {
    module: "nifti_data_layer"
    layer: "NumpyTrainDataLayer"
  }
  include: { phase: TRAIN }
}

but when I load the prototxt it gives this error :

I0511 16:34:41.107846  8992 layer_factory.hpp:77] Creating layer data

F0511 16:34:41.107899  8992 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, ContrastiveLoss, Convolution, Crop, Data, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, Input, LRN, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Parameter, Pooling, Power, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)


The python layer is intended to read images out of 3D .npy files. I'm using the HEAD of BVLC/Caffe.

I'm following the example prototxt here and code here as a reference. Any ideas why it does not work ?

Mohamed Ezz

unread,
May 11, 2016, 5:02:43 PM5/11/16
to Caffe Users
It turns out that I had to re-build caffe with

WITH_PYTHON_LAYER = 1

in the Makefile.config

Reply all
Reply to author
Forward
0 new messages