How to use leveldb and What kind of dataLayer I can use in pycaffe interface?
<p>I tried to make train/val.prototxt using leveldb by caffe python interface:</p>

<pre><code>layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  data_param {
    source: "/home/youngwan/data/cifar10/cifar10-gcn-leveldb-splits/cifar10_full_train_leveldb_padded"
    batch_size: 100
    backend: LEVELDB
  }
  transform_param {
    mean_file: "/home/youngwan/data/cifar10/cifar10-gcn-leveldb-splits/paddedmean.binaryproto"
    mirror: 1
    crop_size: 32
  }
  include: { phase: TRAIN }
}
</code></pre>

<p>But in caffe python interface, I can't find a proper datalayer python wrapper(e.g., <code>L.MemoryData</code>) even though I tried to find examples and tutorials in BLVC/caffe page.</p>

<p>Could you notice which <code>'L.xxx'</code> layer I can use it?</p>

<p>Using <code>caffe.NetSpec()</code> interface, you can have all the layers you want:</p>

<pre><code>from caffe import layers as L, params as P
cifar = L.Data(data_param={'source': '/home/youngwan/data/cifar10/cifar10-gcn-leveldb-splits/cifar10_full_train_leveldb_padded', 
                           'batch_size': 100,
                           'backend': P.Data.LEVELDB},
               transform_param={'mean_file': '/home/youngwan/data/cifar10/cifar10-gcn-leveldb-splits/paddedmean.binaryproto',
                                'mirror': 1,
                                'crop_size': 32},
               include={'phase':caffe.TRAIN})
</code></pre>

<p>Basically, <code>L.&lt;layer type&gt;</code> defines a layer of type <code>&lt;layer type&gt;</code>.</p>

python neural-network deep-learning caffe pycaffe