I want to use the following convolutional neural network:
http://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/
with caffe built from https://github.c
Solution:
You should modify net.prototxt
from:
layers { ... type: CROP }
to
layer { ... type: "Crop" }
and meanwhile, other layers' parameter in the prototxt should also be modified similarly to:
layer { ... type: "TypeString" }
,
and the TypeString
can be found from:
REGISTER_LAYER_CLASS(some_layer_name)
in related some_layer_name_layer.cpp
file. For example, REGISTER_LAYER_CLASS(Data)
in data_layer.cpp
means the TypeString
should be Data
when writing a data layer in net.prototxt
.REGISTER_LAYER_CREATOR(some_layer_name, GetSomeLayer)
in layer_factory.cpp
. For example, REGISTER_LAYER_CREATOR(Convolution, GetConvolutionLayer)
means the TypeString
should be Convolution
when writing a convolution layer in net.prototxt
.Reason:
The reason for your problem is: you used an old layer parameter format
layers { ... type: SOMELAYERNAME }
.
and this format coming from V1LayerParameter
in caffe.proto doesn't support some newer layer type including the crop
layer.
You can confirm this by checking that enum LayerType
of V1LayerParameter
doesn't include layer type CROP
.
To avoid this probelm, you can always use the newest format:
layer { ... type: "TypeString" }
in which the TypeString
can be found in the 2 places mentioned above.
Edit 1
A simple remark:
In general, the error:
Error parsing text-format caffe.xxxParameter: ...
can always be solved by checking that the xxx.prototxt
files use the right field names declared in caffe.proto and right values are assigned to them(by checking the field type and its value range).