Unknown Layer Type (crop) In Caffe For Windows
Solution 1:
Answer :
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:
- The line
REGISTER_LAYER_CLASS(some_layer_name)
in relatedsome_layer_name_layer.cpp
file. For example,REGISTER_LAYER_CLASS(Data)
indata_layer.cpp
means theTypeString
should beData
when writing a data layer innet.prototxt
. REGISTER_LAYER_CREATOR(some_layer_name, GetSomeLayer)
inlayer_factory.cpp
. For example,REGISTER_LAYER_CREATOR(Convolution, GetConvolutionLayer)
means theTypeString
should beConvolution
when writing a convolution layer innet.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).
Post a Comment for "Unknown Layer Type (crop) In Caffe For Windows"