title: pycaffe Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type
body: <p>I implemented DeformableConvolution which is a new type of convolution layer in caffe. It is inherited from BaseConvolution class just like ConvolutionLayer and has the same parameter as convolution.</p>
  
  <p>Now I can use <code>./build/tools/caffe XXX</code> to train and test net contains this new layer as expected. But when I use pycaffe to visualize features. It came to this error.</p>
  
  <p>pycaffe command:</p>
  
  <pre><code>caffe.set_mode_gpu()
  net = caffe.Net(‘mnist/mnist.prototxt',
              ‘models/mnist_iter_5000.caffemodel',
              caffe.TEST)
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) 
                        Unknown layer type: DeformableConvolution
  </code></pre>
  
  <p>I searched it and found it was mainly caused by missing codes in <code>caffe.proto</code> and <code>layer_factory.cpp</code>. Since this layer has same parameters as normal convolution layer, I have no idea how should I deal with this two files. And it can be trained as expected by <code>./build/tools/caffe</code>, so I wonder if this is caused only by something related to pycaffe?</p>
  
  <p>layer demo:</p>
  
  <pre><code>layer {
    name: "conv11"
    type: "DeformableConvolution"
    bottom: "data"
    bottom: "conv11_offset"
    top: "conv11"
    param {
      lr_mult: 0
    }
    convolution_param {
      num_output: 32
      kernel_size: 3
      stride: 1
      dilation: 1
      pad: 1
    }
  }
  </code></pre>