No field named force_gray in TransformationParameter?

62 views
Skip to first unread message

5argon

unread,
Feb 15, 2016, 9:01:08 AM2/15/16
to Caffe Users
After trying to forcing the color channel to greyscale like this :

layers {
  name
: "data"
  type
: DATA
  top
: "data"
  include
{
    phase
: TRAIN
 
}
  transform_param
{
      mean_file
:"./mean.binaryphoto"
      force_gray
: true
 
}
  data_param
{
    source
: "./train_images_3_lmdb"
    batch_size
: 1
    backend
: LMDB
 
}
}


layers
{
  name
: "data"
  type
: DATA
  top
: "data"
  include
{
    phase
: TEST
 
}
  transform_param
{
    mean_file
:"./mean.binaryphoto"
    force_gray
: true
 
}
  data_param
{
    source
: "./test_images_3_lmdb"
    batch_size
: 1
    backend
: LMDB
 
}
}




The following error occured :

[libprotobuf ERROR google/protobuf/text_format.cc:291] Error parsing text-format caffe.NetParameter: 12:17: Message type "caffe.TransformationParameter" has no field named "force_gray".


I checked `/src/caffe/proto` and make sure that `force_gray` was there under the `TransformationParameter` so why I got this error?



message
TransformationParameter {
 
// For data pre-processing, we can do simple scaling and subtracting the
 
// data mean, if provided. Note that the mean subtraction is always carried
 
// out before scaling.
  optional
float scale = 1 [default = 1];
 
// Specify if we want to randomly mirror data.
  optional
bool mirror = 2 [default = false];
 
// Specify if we would like to randomly crop an image.
  optional uint32 crop_size
= 3 [default = 0];
 
// mean_file and mean_value cannot be specified at the same time
  optional
string mean_file = 4;
 
// if specified can be repeated once (would substract it from all the channels)
 
// or can be repeated the same number of times as channels
 
// (would subtract them from the corresponding channel)
  repeated
float mean_value = 5;
 
// Force the decoded image to have 3 color channels.
  optional
bool force_color = 6 [default = false];
 
// Force the decoded image to have 1 color channels.
  optional
bool force_gray = 7 [default = false];
}


I also did the same to my TEST data layer.

Another question is, will this option correctly use the mean_file that was computed from colored image as greyscale mean as well?

Jan C Peters

unread,
Feb 15, 2016, 9:50:47 AM2/15/16
to Caffe Users
Not sure about the mean file, my guess is that it won't work though.

The error you see: maybe your code is more recent than the binary? Try to recompile your caffe binaries. And do a git pull while you're at it.

Jan
Reply all
Reply to author
Forward
0 new messages