Caffe: Data Layer unknown layer type

Created on 18 Mar 2016  ·  11Comments  ·  Source: BVLC/caffe

I am trying to follow the example here (https://github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb) to classify one image on a network I have trained. I am currently able to classify batch images using a DenseImageData layer. However I am now trying to classify single images in real time from a camera. Anyway, I now set up my data layer as shown below, using this at reference (https://github.com/BVLC/caffe/blob/master/models/bvlc_reference_caffenet/deploy.prototxt). When I try to call caffe.Net in python, I get the following error: * Error parsing text-format caffe.NetParameter: 7:15: Message type "caffe.LayerParameter" has no field named "input_param"_. When I comment out the input_param layer, I get the following error: _Unknown layer type: Input. *

Thanks for the help!!!

'''layer {
name: "data"
type: "Input"
top: "data"
#top: "label"
input_param { shape: { dim: 1 dim: 3 dim: 195 dim: 185 } }
}'''

Most helpful comment

Same issue, here is solution:

layer {
  name: "data"
  type: "Input"
  top: "data"
  input_param { shape: { dim: 1 dim: 3 dim: 227 dim: 227 } }
}

to

input: "data"
input_shape {
  dim: 1
  dim: 3
  dim: 227
  dim: 227
}

This is very annoying situation with outdated forks and .prototxt format changing in caffe master.

All 11 comments

How recent is your build? Input layers were added 20 days ago with https://github.com/BVLC/caffe/pull/3211.

Thanks @lukeyeager that is totally my issue. How would I go about adding this layer type into my caffe build? I am using a custom version of caffe found here: mi.eng.cam.ac.uk/projects/segnet/tutorial.html. Or is there another way to go about classifying a single image in python?

I guess you could just use the old definition. Instead of adding a layer, you specify the following directly in the root og the prototxt:
input: "data"
input_dim: 1
input_dim: 3
input_dim: 195
input_dim: 185

Alternatively you can find Alex' github repo here it seems: https://github.com/alexgkendall/caffe-segnet. If you fork the repo, you should be able to add the Caffe repo as remote and fetch the commits. You will have to figure out the details yourself though ;)

Yup good call. Got it working last night after digging through old commits of the example files. I might try to merge as you suggested, but this will work for now. Thanks @lukeyeager @ShaggO !

Same issue, here is solution:

layer {
  name: "data"
  type: "Input"
  top: "data"
  input_param { shape: { dim: 1 dim: 3 dim: 227 dim: 227 } }
}

to

input: "data"
input_shape {
  dim: 1
  dim: 3
  dim: 227
  dim: 227
}

This is very annoying situation with outdated forks and .prototxt format changing in caffe master.

The examples were updated to use the latest features. If you're using an old version of the code, use the examples checked into the repo at that time (e.g. https://github.com/BVLC/caffe/tree/rc3/examples).

The code is backwards-compatible with old examples, but the examples are not backwards-compatible with old code. This is as it should be.

i have same problem and try this format :
input: "data"

input_shape {
  dim: 1
  dim: 3
  dim: 640
  dim: 480
}

but don't work!

WARNING: Logging before InitGoogleLogging() is written to STDERR
I0323 16:43:39.494524  6784 common.cpp:36] System entropy source not available, using fallback algorithm to generate seed instead.
I0323 16:43:43.032114  6784 upgrade_proto.cpp:67] Attempting to upgrade input file specified using deprecated input fields: C:/Users/127051/Documents/Visual Studio 2015/Projects/C++/Caffe/CaffeTest/x64/Release/net_struct.prototxt
I0323 16:43:43.033090  6784 upgrade_proto.cpp:70] Successfully upgraded file specified using deprecated input fields.
W0323 16:43:43.033602  6784 upgrade_proto.cpp:72] Note that future Caffe releases will only support input layers and not input fields.
I0323 16:43:43.034595  6784 net.cpp:53] Initializing net from parameters:
state {
  phase: TEST
  level: 0
}
layer {
  name: "input"
  type: "Input"
  top: "data"
  input_param {
    shape {
      dim: 1
      dim: 3
      dim: 640
      dim: 480
    }
  }
}
...


I0323 16:43:44.057319  6784 layer_factory.cpp:58] Creating layer input
F0323 16:43:44.068845  6784 layer_factory.cpp:62] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Input (known types: Convolution, Eltwise, LRN, Pooling, Power, Python, ReLU, Sigmoid, Softmax, Split, TanH)
*** Check failure stack trace: ***

Something is wrong with your build. Are you using stock caffe.exe or your own executable?

If using your own executable please add /DCMAKE_WINDOWS_BUILD to your definitions.

Please continue this dicussion on the mailing list.

From https://github.com/BVLC/caffe/blob/master/CONTRIBUTING.md:

Please do not post usage, installation, or modeling questions, or other requests for help to Issues.
Use the caffe-users list instead. This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.

If unknown layer is imagedata then uncomment this flag OPENCV :=3 in Makefile.config
then compile again ... by

     sudo make clean | sudo  make all
Was this page helpful?
0 / 5 - 0 ratings

Related issues

inferrna picture inferrna  ·  3Comments

serimp picture serimp  ·  3Comments

FreakTheMighty picture FreakTheMighty  ·  3Comments

prathmeshrmadhu picture prathmeshrmadhu  ·  3Comments

hawklucky picture hawklucky  ·  3Comments